From b0ef3ed48eb8c1982c9d8b8063d856c83d116764 Mon Sep 17 00:00:00 2001 From: Jiayi Ye Date: Mon, 20 Oct 2014 15:01:08 +0800 Subject: [PATCH] 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 Acked-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rts5208/ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index 228e483..b4612fb 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -2599,9 +2599,9 @@ static int mspro_rw_multi_sector(struct scsi_cmnd *srb, if (count > sector_cnt) { if (mode_2k) - ms_card->seq_mode |= MODE_2K_SEQ; + ms_card->seq_mode = MODE_2K_SEQ; else - ms_card->seq_mode |= MODE_512_SEQ; + ms_card->seq_mode = MODE_512_SEQ; } } else { count = sector_cnt; -- 2.7.4