mtd: lpddr_cmds: remove unused words variable
PATCH 1/1 mtd: lpddr_cmds: remove unused words variable
clang with W=1 reports drivers/mtd/lpddr/lpddr_cmds.c:409:31: error: variable
'words' set but not used [-Werror,-Wunused-but-set-variable]
int ret, wbufsize, word_gap, words;
^This variable is not used so remove it.
Signed-off-by Tom Rix <[email protected]>
--- drivers/mtd/lpddr/lpddr_cmds.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mtd/lpddr/lpddr_cmds.c +2 -5
@@ -406,7 +406,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip, {struct lpddr_private *lpddr = map->fldrv_priv;map_word datum; -int ret, wbufsize, word_gap, words; +int ret, wbufsize, word_gap;const struct kvec *vec;unsigned long vec_seek;unsigned long prog_buf_ofs;
@@ -421,10 +421,7 @@ static int do_write_buffer(struct map_info *map, struct flchip *chip, }/* Figure out the number of words to write */ word_gap = (-adr & (map_bankwidth (map)-1 )); - words = (len - word_gap +map_bankwidth (map) -1 ) /map_bankwidth (map); -if (!word_gap) { - words--; - }else { +if (word_gap) { word_gap =map_bankwidth (map) - word_gap; adr -= word_gap; datum =map_word_ff (map);
Signature · 1 line
2.27.0
Quoted 8 lines · Tom Rix
clang with W=1 reports
drivers/mtd/lpddr/lpddr_cmds.c:409:31: error: variable
'words' set but not used [-Werror,-Wunused-but-set-variable]int ret, wbufsize, word_gap, words; ^This variable is not used so remove it.
Signed-off-by Tom Rix <[email protected]>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.
Miquel