Skip to content

Commit

Permalink
lib/ts_bm.c: remove redundant store to variable consumed after addition
Browse files Browse the repository at this point in the history
There is no need to store the result of the addition back to variable
consumed after the addition.  The store is redundant, replace += with just
+

Cleans up clang scan build warning: lib/ts_bm.c:83:11: warning: Although
the value stored to 'consumed' is used in the enclosing expression, the
value is never actually read from 'consumed' [deadcode.DeadStores]

Link: https://lkml.kernel.org/r/20220704215325.600993-1-colin.i.king@gmail.com
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
Colin Ian King authored and akpm committed Jul 18, 2022
1 parent 6d529ea commit 4a70ce5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ts_bm.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static unsigned int bm_find(struct ts_config *conf, struct ts_state *state)

/* London calling... */
DEBUGP("found!\n");
return consumed += (shift-(bm->patlen-1));
return consumed + (shift-(bm->patlen-1));

next: bs = bm->bad_shift[text[shift-i]];

Expand Down

0 comments on commit 4a70ce5

Please sign in to comment.