]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
include/intarith: drop isp2()
authorKefu Chai <tchaikov@gmail.com>
Sun, 21 Aug 2022 16:30:34 +0000 (00:30 +0800)
committerKefu Chai <tchaikov@gmail.com>
Mon, 22 Aug 2022 10:03:59 +0000 (18:03 +0800)
as it is not used anymore.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/include/intarith.h
src/test/test_intarith.cc

index d3eaff15635f773bdb35314cbea09c35fb2773fb..281aa8b33497cc9b11a06c16217afa99e91a6751 100644 (file)
@@ -33,14 +33,6 @@ constexpr inline std::make_unsigned_t<std::common_type_t<T, U>> shift_round_up(T
   return (x + (1 << y) - 1) >> y;
 }
 
-/*
- * Wrapper to determine if value is a power of 2
- */
-template<typename T>
-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.
index c7dae7a7dcd6c1eb75d4d05d70c133d4c4441b99..bb01343d4d17a239e8bb5e5ef44ec41b12266f11 100644 (file)
@@ -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));