staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Tue, 17 Nov 2015 20:06:40 +0000 (22:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Dec 2015 23:40:18 +0000 (15:40 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/hash.c

index d285117af3adaa21cd327b0889a53bf96b0e623a..4d50510434be5b1adbc9583879169e95fa4b5584 100644 (file)
  *   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();