All of lore.kernel.org
 help / color / mirror / Atom feed
* [lustre-devel] [PATCH 0/2] Remove the last use and definition of IS_PO2
@ 2015-11-17 20:06 Aya Mahfouz
  2015-11-17 20:06 ` [lustre-devel] [PATCH 1/2] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 Aya Mahfouz
  2015-11-17 20:07 ` [lustre-devel] [PATCH 2/2] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 Aya Mahfouz
  0 siblings, 2 replies; 3+ messages in thread
From: Aya Mahfouz @ 2015-11-17 20:06 UTC (permalink / raw)
  To: lustre-devel

Concerned with the removal of IS_PO2 by replacing its use
with is_power_of_2 and then removing the definition.

Aya Mahfouz (2):
  staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2
  staging: lustre: libcfs.h: remove IS_PO2 and __is_po2

 drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 -------
 drivers/staging/lustre/lustre/libcfs/hash.c          | 3 ++-
 2 files changed, 2 insertions(+), 8 deletions(-)

-- 
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [lustre-devel] [PATCH 1/2] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2
  2015-11-17 20:06 [lustre-devel] [PATCH 0/2] Remove the last use and definition of IS_PO2 Aya Mahfouz
@ 2015-11-17 20:06 ` Aya Mahfouz
  2015-11-17 20:07 ` [lustre-devel] [PATCH 2/2] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 Aya Mahfouz
  1 sibling, 0 replies; 3+ messages in thread
From: Aya Mahfouz @ 2015-11-17 20:06 UTC (permalink / raw)
  To: lustre-devel

Replaces IS_PO2 by is_power_of_2. It is more accurate to use
is_power_of_2 since it returns 1 for numbers that are powers
of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are
powers of 2.

Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/lustre/lustre/libcfs/hash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
index d285117..4d50510 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -107,6 +107,7 @@
  *   table. Also, user can break the iteration by return 1 in callback.
  */
 #include <linux/seq_file.h>
+#include <linux/log2.h>
 
 #include "../../include/linux/libcfs/libcfs.h"
 
@@ -1777,7 +1778,7 @@ cfs_hash_rehash_cancel_locked(struct cfs_hash *hs)
 	for (i = 2; cfs_hash_is_rehashing(hs); i++) {
 		cfs_hash_unlock(hs, 1);
 		/* raise console warning while waiting too long */
-		CDEBUG(IS_PO2(i >> 3) ? D_WARNING : D_INFO,
+		CDEBUG(is_power_of_2(i >> 3) ? D_WARNING : D_INFO,
 		       "hash %s is still rehashing, rescheded %d\n",
 		       hs->hs_name, i - 1);
 		cond_resched();
-- 
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [lustre-devel] [PATCH 2/2] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2
  2015-11-17 20:06 [lustre-devel] [PATCH 0/2] Remove the last use and definition of IS_PO2 Aya Mahfouz
  2015-11-17 20:06 ` [lustre-devel] [PATCH 1/2] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 Aya Mahfouz
@ 2015-11-17 20:07 ` Aya Mahfouz
  1 sibling, 0 replies; 3+ messages in thread
From: Aya Mahfouz @ 2015-11-17 20:07 UTC (permalink / raw)
  To: lustre-devel

Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have
been replaced by is_power_of_2

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
index 4d74e8a..7f76b20 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h
@@ -42,13 +42,6 @@
 
 #include "curproc.h"
 
-static inline int __is_po2(unsigned long long val)
-{
-	return !(val & (val - 1));
-}
-
-#define IS_PO2(val) __is_po2((unsigned long long)(val))
-
 #define LOWEST_BIT_SET(x)       ((x) & ~((x) - 1))
 
 /*
-- 
2.4.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-17 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 20:06 [lustre-devel] [PATCH 0/2] Remove the last use and definition of IS_PO2 Aya Mahfouz
2015-11-17 20:06 ` [lustre-devel] [PATCH 1/2] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 Aya Mahfouz
2015-11-17 20:07 ` [lustre-devel] [PATCH 2/2] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 Aya Mahfouz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.