提交 037f7416 编写于 作者: J Janani Ravichandran 提交者: Greg Kroah-Hartman

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: NJanani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7e43d4d2
...@@ -113,7 +113,7 @@ int hfi1_alloc_lkey(struct hfi1_mregion *mr, int dma_region) ...@@ -113,7 +113,7 @@ int hfi1_alloc_lkey(struct hfi1_mregion *mr, int dma_region)
((((1 << (24 - hfi1_lkey_table_size)) - 1) & rkt->gen) ((((1 << (24 - hfi1_lkey_table_size)) - 1) & rkt->gen)
<< 8); << 8);
if (mr->lkey == 0) { if (mr->lkey == 0) {
mr->lkey |= 1 << 8; mr->lkey = 1 << 8;
rkt->gen++; rkt->gen++;
} }
rcu_assign_pointer(rkt->table[r], mr); rcu_assign_pointer(rkt->table[r], mr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册