aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet
diff options
context:
space:
mode:
authorArushi Singhal <arushisinghal19971997@gmail.com>2017-03-22 21:23:33 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-27 14:24:49 +0200
commit08d6ccf39bfb752fdef465f73e6fc7417259af31 (patch)
tree9e0babc3e03c0b41654d6e4cec665ffded21cca3 /drivers/staging/lustre/lnet
parentstaging: greybus: compress return logic (diff)
downloadlinux-dev-08d6ccf39bfb752fdef465f73e6fc7417259af31.tar.xz
linux-dev-08d6ccf39bfb752fdef465f73e6fc7417259af31.zip
staging: lustre: Replace a bit shift by a use of BIT.
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>
Diffstat (limited to 'drivers/staging/lustre/lnet')
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c8
-rw-r--r--drivers/staging/lustre/lnet/lnet/lib-ptl.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index eaa4399e6a2e..3ed3b08c122c 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -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;
}
diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
index 63cce0c4a065..33332724ab94 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c
@@ -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