提交 57aac2f1 编写于 作者: J Jeff Mahoney 提交者: Jens Axboe

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: NJeff Mahoney <jeffm@suse.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: NMatias Bjørling <m@bjorling.me>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 87c32077
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册