summaryrefslogtreecommitdiff
path: root/drivers/lightnvm
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2016-05-06 20:02:54 +0200
committerJens Axboe <axboe@fb.com>2016-05-06 12:51:10 -0600
commit57aac2f1be4a0711b7f24f7d367e8672ebaa3844 (patch)
tree43c7aef6fafb634bd86eabb345dd0227aa8e989a /drivers/lightnvm
parent87c32077819c695cbc5ab00226a28010cd5806c3 (diff)
lightnvm: fix "warning: ‘ret’ may be used uninitialized"
This fixes the following warnings: drivers/lightnvm/sysblk.c:125:9: warning: ‘ret’ may be used uninitialized in this function drivers/lightnvm/sysblk.c:275:15: warning: ‘ret’ may be used uninitialized in this function In both cases, ret is only set from within a loop that may not be entered. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Matias Bjørling <m@bjorling.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/lightnvm')
-rw-r--r--drivers/lightnvm/sysblk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/lightnvm/sysblk.c b/drivers/lightnvm/sysblk.c
index 321de1f154c5..b1e1404e6951 100644
--- a/drivers/lightnvm/sysblk.c
+++ b/drivers/lightnvm/sysblk.c
@@ -122,7 +122,7 @@ static int nvm_get_all_sysblks(struct nvm_dev *dev, struct sysblk_scan *s,
struct ppa_addr *ppas, nvm_bb_update_fn *fn)
{
struct ppa_addr dppa;
- int i, ret;
+ int i, ret = 0;
s->nr_ppas = 0;
@@ -272,7 +272,7 @@ static int nvm_write_and_verify(struct nvm_dev *dev, struct nvm_sb_info *info,
{
struct nvm_system_block nvmsb;
void *buf;
- int i, sect, ret, bufsz;
+ int i, sect, ret = 0, bufsz;
struct ppa_addr *ppas;
nvm_cpu_to_sysblk(&nvmsb, info);