nvdimm/btt: fix variable 'rc' set but not used
PATCH v3 1/1 nvdimm/btt: fix variable 'rc' set but not used
drivers/nvdimm/btt.c: In function 'btt_read_pg':drivers/nvdimm/btt.c:1264:8: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
int rc;
^~Add a ratelimited message in case a storm of errors is encountered.
---
v3: remove the unused "rc" per Vishal.
v2: include the block address that is returning an error per Dan.
drivers/nvdimm/btt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/nvdimm/btt.c +4 -4
@@ -1261,11 +1261,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, ret =btt_data_read (arena, page, off, postmap, cur_len);if (ret) { -int rc; -/* Media error - set the e_flag */ - rc =btt_map_write (arena, premap, postmap,0 ,1 , -NVDIMM_IO_ATOMIC ); +if (btt_map_write (arena, premap, postmap,0 ,1 ,NVDIMM_IO_ATOMIC )) +dev_warn_ratelimited (to_dev (arena), +"Error persistently tracking bad blocks at %#x\n" , + premap); goto out_rtt; }
Signature · 1 line
1.8.3.1
Quoted 8 lines · Qian Cai
drivers/nvdimm/btt.c: In function 'btt_read_pg':drivers/nvdimm/btt.c:1264:8: warning: variable 'rc' set but not used [-Wunused-but-set-variable]int rc; ^~Add a ratelimited message in case a storm of errors is encountered.
Quoted 8 lines
Fixes d9b83c756953 ("libnvdimm, btt: rework error clearing")Signed-off-by Qian Cai <[email protected]>---
v3: remove the unused "rc" per Vishal.
v2: include the block address that is returning an error per Dan.drivers/nvdimm/btt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Looks good,
Quoted 11 lines
drivers/nvdimm/btt.c +0
-2@@ -1261,11 +1261,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, ret =btt_data_read (arena, page, off, postmap, cur_len);if (ret) { -int rc; -
drivers/nvdimm/btt.c static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, · line 1271
Quoted 10 lines
drivers/nvdimm/btt.c +4
-2/* Media error - set the e_flag */ - rc =btt_map_write (arena, premap, postmap,0 ,1 , -NVDIMM_IO_ATOMIC ); +if (btt_map_write (arena, premap, postmap,0 ,1 ,NVDIMM_IO_ATOMIC )) +dev_warn_ratelimited (to_dev (arena), +"Error persistently tracking bad blocks at %#x\n" , + premap); goto out_rtt; }
_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]