public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: scsi_debug: Remove a useless memset()
@ 2024-09-07  6:27 Christophe JAILLET
  2024-09-13  0:45 ` Martin K. Petersen
  2024-09-19 15:52 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-09-07  6:27 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-scsi

'arr' is kzalloc()'ed, so there is no need to call memset(.., 0, ...) on
it. It is already cleared.

This is a follow up of commit b952eb270df3 ("scsi: scsi_debug: Allocate the
MODE SENSE response from the heap").

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/scsi_debug.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index a9d8a9c62663..d95f417e24c0 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2760,7 +2760,6 @@ static int resp_mode_sense(struct scsi_cmnd *scp,
 	else
 		bd_len = 0;
 	alloc_len = msense_6 ? cmd[4] : get_unaligned_be16(cmd + 7);
-	memset(arr, 0, SDEBUG_MAX_MSENSE_SZ);
 	if (0x3 == pcontrol) {  /* Saving values not supported */
 		mk_sense_buffer(scp, ILLEGAL_REQUEST, SAVING_PARAMS_UNSUP, 0);
 		return check_condition_result;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: scsi_debug: Remove a useless memset()
  2024-09-07  6:27 [PATCH] scsi: scsi_debug: Remove a useless memset() Christophe JAILLET
@ 2024-09-13  0:45 ` Martin K. Petersen
  2024-09-19 15:52 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-09-13  0:45 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: James E.J. Bottomley, Martin K. Petersen, linux-kernel,
	kernel-janitors, linux-scsi


Christophe,

> 'arr' is kzalloc()'ed, so there is no need to call memset(.., 0, ...)
> on it. It is already cleared.

Applied to 6.12/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: scsi_debug: Remove a useless memset()
  2024-09-07  6:27 [PATCH] scsi: scsi_debug: Remove a useless memset() Christophe JAILLET
  2024-09-13  0:45 ` Martin K. Petersen
@ 2024-09-19 15:52 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2024-09-19 15:52 UTC (permalink / raw)
  To: James E.J. Bottomley, Christophe JAILLET
  Cc: Martin K . Petersen, linux-kernel, kernel-janitors, linux-scsi

On Sat, 07 Sep 2024 08:27:22 +0200, Christophe JAILLET wrote:

> 'arr' is kzalloc()'ed, so there is no need to call memset(.., 0, ...) on
> it. It is already cleared.
> 
> This is a follow up of commit b952eb270df3 ("scsi: scsi_debug: Allocate the
> MODE SENSE response from the heap").
> 
> 
> [...]

Applied to 6.12/scsi-queue, thanks!

[1/1] scsi: scsi_debug: Remove a useless memset()
      https://git.kernel.org/mkp/scsi/c/bba20b894e3c

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-19 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-07  6:27 [PATCH] scsi: scsi_debug: Remove a useless memset() Christophe JAILLET
2024-09-13  0:45 ` Martin K. Petersen
2024-09-19 15:52 ` Martin K. Petersen

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