From: Kefu Chai Date: Sun, 21 Aug 2022 16:30:34 +0000 (+0800) Subject: include/intarith: drop isp2() X-Git-Tag: v18.0.0~196^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=275ec55c952c257945e61c981ce150e2b85d5e4f;p=ceph.git include/intarith: drop isp2() as it is not used anymore. Signed-off-by: Kefu Chai --- diff --git a/src/include/intarith.h b/src/include/intarith.h index d3eaff15635f..281aa8b33497 100644 --- a/src/include/intarith.h +++ b/src/include/intarith.h @@ -33,14 +33,6 @@ constexpr inline std::make_unsigned_t> shift_round_up(T return (x + (1 << y) - 1) >> y; } -/* - * Wrapper to determine if value is a power of 2 - */ -template -constexpr inline bool isp2(T x) { - return (x & (x - 1)) == 0; -} - /* * Wrappers for various sorts of alignment and rounding. The "align" must * be a power of 2. Often times it is a block, sector, or page. diff --git a/src/test/test_intarith.cc b/src/test/test_intarith.cc index c7dae7a7dcd6..bb01343d4d17 100644 --- a/src/test/test_intarith.cc +++ b/src/test/test_intarith.cc @@ -62,9 +62,6 @@ TEST(intarith, ctz) { } TEST(intarith, p2family) { - ASSERT_TRUE(isp2(0x100)); - ASSERT_FALSE(isp2(0x1234)); - ASSERT_EQ(1024, p2align(1200, 1024)); ASSERT_EQ(1024, p2align(1024, 1024)); ASSERT_EQ(0x1200, p2align(0x1234, 0x100));