2022-01-23 00:14:25

by kernel test robot

[permalink] [raw]
Subject: drivers/nvme/host/fabrics.c:1095:5-8: Unneeded variable: "ret". Return "0" on line 1109

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b57f458985742bd1c585f4c7f36d04634ce1143
commit: f18ee3d988157ebcadc9b7e5fd34811938f50223 nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics
date: 4 weeks ago
config: x86_64-randconfig-c022-20220117 (https://download.01.org/0day-ci/archive/20220122/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


cocci warnings: (new ones prefixed by >>)
>> drivers/nvme/host/fabrics.c:1095:5-8: Unneeded variable: "ret". Return "0" on line 1109

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]


2022-01-23 00:14:27

by kernel test robot

[permalink] [raw]
Subject: [PATCH] nvme-fabrics: fix returnvar.cocci warnings

From: kernel test robot <[email protected]>

drivers/nvme/host/fabrics.c:1095:5-8: Unneeded variable: "ret". Return "0" on line 1109


Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes: f18ee3d98815 ("nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics")
CC: Hannes Reinecke <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b57f458985742bd1c585f4c7f36d04634ce1143
commit: f18ee3d988157ebcadc9b7e5fd34811938f50223 nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics
:::::: branch date: 13 hours ago
:::::: commit date: 4 weeks ago

fabrics.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -1092,7 +1092,6 @@ static void __nvmf_concat_opt_tokens(str
static int nvmf_dev_show(struct seq_file *seq_file, void *private)
{
struct nvme_ctrl *ctrl;
- int ret = 0;

mutex_lock(&nvmf_dev_mutex);
ctrl = seq_file->private;
@@ -1106,7 +1105,7 @@ static int nvmf_dev_show(struct seq_file

out_unlock:
mutex_unlock(&nvmf_dev_mutex);
- return ret;
+ return 0;
}

static int nvmf_dev_open(struct inode *inode, struct file *file)

2022-01-23 00:16:28

by Chaitanya Kulkarni

[permalink] [raw]
Subject: Re: [PATCH] nvme-fabrics: fix returnvar.cocci warnings

On 1/21/22 19:17, kernel test robot wrote:
> External email: Use caution opening links or attachments
>
>
> From: kernel test robot <[email protected]>
>
> drivers/nvme/host/fabrics.c:1095:5-8: Unneeded variable: "ret". Return "0" on line 1109
>
>
> Remove unneeded variable used to store return value.
>
> Generated by: scripts/coccinelle/misc/returnvar.cocci
>
> Fixes: f18ee3d98815 ("nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics")
> CC: Hannes Reinecke <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---


Looks good.

Reviewed-by: Chaitanya Kulkarni <[email protected]>