public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: Delete a redundant memory setting in megasas_alloc_cmds()
@ 2019-06-17 11:00 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2019-06-17 11:00 UTC (permalink / raw)
  To: linux-scsi, megaraidlinux.pdl, James E. J. Bottomley,
	Kashyap Desai, Martin K. Petersen, Shivasharan Srikanteshwara,
	Sumit Saxena
  Cc: kernel-janitors, LKML

From: Markus Elfring <elfring@users.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@users.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-17 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-17 11:00 [PATCH] megaraid_sas: Delete a redundant memory setting in megasas_alloc_cmds() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox