* [PATCH linux-next] scsi: snic: Remove the unneeded result variable
@ 2022-08-26 7:26 cgel.zte
0 siblings, 0 replies; only message in thread
From: cgel.zte @ 2022-08-26 7:26 UTC (permalink / raw)
To: martin.petersen
Cc: kartilak, sebaddel, jejb, linux-scsi, linux-kernel, ye xingchen,
Zeal Robot
From: ye xingchen <ye.xingchen@zte.com.cn>
Return the value 0 and -ENOMEM directly instead of storing it in another
redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
drivers/scsi/snic/snic_trc.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/snic/snic_trc.c b/drivers/scsi/snic/snic_trc.c
index c2e5ab7e976c..9796bf280775 100644
--- a/drivers/scsi/snic/snic_trc.c
+++ b/drivers/scsi/snic/snic_trc.c
@@ -109,16 +109,15 @@ snic_trc_init(void)
{
struct snic_trc *trc = &snic_glob->trc;
void *tbuf = NULL;
- int tbuf_sz = 0, ret;
+ int tbuf_sz = 0;
tbuf_sz = (snic_trace_max_pages * PAGE_SIZE);
tbuf = vzalloc(tbuf_sz);
if (!tbuf) {
SNIC_ERR("Failed to Allocate Trace Buffer Size. %d\n", tbuf_sz);
SNIC_ERR("Trace Facility not enabled.\n");
- ret = -ENOMEM;
- return ret;
+ return -ENOMEM;
}
trc->buf = (struct snic_trc_data *) tbuf;
@@ -131,9 +130,8 @@ snic_trc_init(void)
trc->enable = true;
SNIC_INFO("Trace Facility Enabled.\n Trace Buffer SZ %lu Pages.\n",
tbuf_sz / PAGE_SIZE);
- ret = 0;
- return ret;
+ return 0;
} /* end of snic_trc_init */
/*
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-26 7:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 7:26 [PATCH linux-next] scsi: snic: Remove the unneeded result variable cgel.zte
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).