[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3921d044-72d6-d092-e792-01c896ae222b@web.de>
Date: Mon, 17 Jun 2019 13:00:28 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-scsi@...r.kernel.org, megaraidlinux.pdl@...adcom.com,
"James E. J. Bottomley" <jejb@...ux.ibm.com>,
Kashyap Desai <kashyap.desai@...adcom.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Shivasharan Srikanteshwara
<shivasharan.srikanteshwara@...adcom.com>,
Sumit Saxena <sumit.saxena@...adcom.com>
Cc: kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] megaraid_sas: Delete a redundant memory setting in
megasas_alloc_cmds()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 17 Jun 2019 12:42:15 +0200
The memory was set to zero already by a call of the function “kcalloc”.
Thus remove an extra call of the function “memset” for this purpose.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/scsi/megaraid/megaraid_sas_base.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 176b59a34a79..047990d3cffd 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4239,8 +4239,6 @@ int megasas_alloc_cmds(struct megasas_instance *instance)
return -ENOMEM;
}
- memset(instance->cmd_list, 0, sizeof(struct megasas_cmd *) *max_cmd);
-
for (i = 0; i < max_cmd; i++) {
instance->cmd_list[i] = kmalloc(sizeof(struct megasas_cmd),
GFP_KERNEL);
--
2.22.0
Powered by blists - more mailing lists