Skip to content
Commit b0ef3ed4 authored by Jiayi Ye's avatar Jiayi Ye Committed by Greg Kroah-Hartman
Browse files

staging: rts5208: fix case of bitwise operator on zero in ms.c



If a variable has value 0, then there is no point in combining it with other things with |, as for any
 x, 0 | x is just x. The following semantic patch finds this problem.
    @@
    expression x,e,e1;
    statement S;
    @@

    if (x == 0) {
      <... when != x = e1
          when != while(...) S
          when != for(...;...;...) S
    (
    *  x |= e
    |
    *  x | e
    )
      ...>
    }

Signed-off-by: default avatarJiayi Ye <yejiayily@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb6c1ee3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment