staging: lustre: Replace a bit shift by a use of BIT.
authorArushi Singhal <arushisinghal19971997@gmail.com>
Wed, 22 Mar 2017 15:53:33 +0000 (21:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Mar 2017 12:24:49 +0000 (14:24 +0200)
This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@
constant c;
@@

-1 << c
+BIT(c)

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/lnet/lib-ptl.c
drivers/staging/lustre/lustre/llite/lproc_llite.c

index eaa4399e6a2e75563d1bae053915858e73150e4e..3ed3b08c122c585878129e2dbd7271fea4a86a17 100644 (file)
@@ -1906,14 +1906,14 @@ ksocknal_connect(struct ksock_route *route)
                if (retry_later) /* needs reschedule */
                        break;
 
-               if (wanted & (1 << SOCKLND_CONN_ANY)) {
+               if (wanted & BIT(SOCKLND_CONN_ANY)) {
                        type = SOCKLND_CONN_ANY;
-               } else if (wanted & (1 << SOCKLND_CONN_CONTROL)) {
+               } else if (wanted & BIT(SOCKLND_CONN_CONTROL)) {
                        type = SOCKLND_CONN_CONTROL;
-               } else if (wanted & (1 << SOCKLND_CONN_BULK_IN)) {
+               } else if (wanted & BIT(SOCKLND_CONN_BULK_IN)) {
                        type = SOCKLND_CONN_BULK_IN;
                } else {
-                       LASSERT(wanted & (1 << SOCKLND_CONN_BULK_OUT));
+                       LASSERT(wanted & BIT(SOCKLND_CONN_BULK_OUT));
                        type = SOCKLND_CONN_BULK_OUT;
                }
 
index 63cce0c4a065aea73afb58ae4a86432c354241eb..33332724ab9469ff5e6f860e7ec4f70e9f306d9a 100644 (file)
@@ -334,7 +334,7 @@ lnet_mt_test_exhausted(struct lnet_match_table *mtable, int pos)
        bmap = &mtable->mt_exhausted[pos >> LNET_MT_BITS_U64];
        pos &= (1 << LNET_MT_BITS_U64) - 1;
 
-       return (*bmap & (1ULL << pos));
+       return (*bmap & BIT(pos));
 }
 
 static void
index 40f1fcf8b5c089b7713bbbb7d4cc1ce94ffcdfb0..c742cba601992bcfc0c0d618ac5dee5b1e80b39b 100644 (file)
@@ -1308,7 +1308,7 @@ static void ll_display_extents_info(struct ll_rw_extents_info *io_extents,
                           r, pct(r, read_tot), pct(read_cum, read_tot),
                           w, pct(w, write_tot), pct(write_cum, write_tot));
                start = end;
-               if (start == 1 << 10) {
+               if (start == 1024) {
                        start = 1;
                        units += 10;
                        unitp++;