diff options
author | Tom Rix <trix@redhat.com> | 2023-03-27 20:06:20 -0400 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-03-28 14:59:21 +0200 |
commit | e6026eb080fa1c1ef6eec24567b733809a5e3018 (patch) | |
tree | 605b113609c6293121fad428fc0ea9ac37d76c74 /drivers/mtd/lpddr | |
parent | 1f79a611e74c97dcb76054b9f28f41a122a7a93b (diff) | |
download | linux-e6026eb080fa1c1ef6eec24567b733809a5e3018.tar.gz linux-e6026eb080fa1c1ef6eec24567b733809a5e3018.tar.bz2 linux-e6026eb080fa1c1ef6eec24567b733809a5e3018.zip |
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 <trix@redhat.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230328000620.1778033-1-trix@redhat.com
Diffstat (limited to 'drivers/mtd/lpddr')
-rw-r--r-- | drivers/mtd/lpddr/lpddr_cmds.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index ee063baed136..3c3939bc2dad 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -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); |