From: Janani Ravichandran Date: Wed, 24 Feb 2016 01:06:12 +0000 (-0500) Subject: staging: rdma: hfi1: Do not use | with a variable with value 0 X-Git-Tag: v4.6-rc1~103^2~27 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=037f741673e0822adcb2bd3bcbd692a148da756a;p=karo-tx-linux.git staging: rdma: hfi1: Do not use | with a variable with value 0 mr->lkey has a value equal to 0. There is no need to combine it with other things with | as for any value x, 0|x is always x. Semantic patch used: @@ expression x, e, e1; statement S; @@ if (x == 0) { ... when != x = e1 when != while(...) S when != for(...;...;...) S ( * x |= e | * x | e ) ... when any } Signed-off-by: Janani Ravichandran Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rdma/hfi1/keys.c b/drivers/staging/rdma/hfi1/keys.c index cb4e6087dfdb..e34f093a6b55 100644 --- a/drivers/staging/rdma/hfi1/keys.c +++ b/drivers/staging/rdma/hfi1/keys.c @@ -113,7 +113,7 @@ int hfi1_alloc_lkey(struct hfi1_mregion *mr, int dma_region) ((((1 << (24 - hfi1_lkey_table_size)) - 1) & rkt->gen) << 8); if (mr->lkey == 0) { - mr->lkey |= 1 << 8; + mr->lkey = 1 << 8; rkt->gen++; } rcu_assign_pointer(rkt->table[r], mr);