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: Jiayi Ye <yejiayily@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiayi Ye 2014-10-20 15:01:08 +08:00 committed by Greg Kroah-Hartman
parent cb6c1ee305
commit b0ef3ed48e

View file

@ -2599,9 +2599,9 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb,
if (count > sector_cnt) { if (count > sector_cnt) {
if (mode_2k) if (mode_2k)
ms_card->seq_mode |= MODE_2K_SEQ; ms_card->seq_mode = MODE_2K_SEQ;
else else
ms_card->seq_mode |= MODE_512_SEQ; ms_card->seq_mode = MODE_512_SEQ;
} }
} else { } else {
count = sector_cnt; count = sector_cnt;