linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk()
@ 2025-08-24 18:02 Abinash Singh
  2025-08-24 18:02 ` [PATCH v9 1/3] scsi: sd: Remove redundant printk after kmalloc failure Abinash Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Abinash Singh @ 2025-08-24 18:02 UTC (permalink / raw)
  To: bvanassche
  Cc: James.Bottomley, abinashsinghlalotra, dlemoal, linux-kernel,
	linux-scsi, martin.petersen

Hi all,

Sorry for making mess in previous replies. My gmail app caused that.


This v9 series contains small cleanups and fixes in sd_revalidate_disk().

On Sat, Aug 23, 2025 at 1:17 AM Bart Van Assche wrote:
> From Documentation/process/coding-style.rst:
> These generic allocation functions all emit a stack dump on failure when
> used without __GFP_NOWARN so there is no use in emitting an additional
> failure message when NULL is returned.
>
> Has this example perhaps been followed? I think it is safe to remove
> this sd_printk() statement.

checkpatch.pl also emits the following warning for this code:
  WARNING: Possible unnecessary 'out of memory' message
  #52: FILE: drivers/scsi/sd.c:3716:
  + if (!lim) {
  +     sd_printk(KERN_WARNING, sdkp,

So I agree with Bart — this printk is redundant and should be removed.
In v9, I have split this into a separate patch for clarity.

Summary of changes in this series:
  Removed  the redundant 'out of memory' printk after kmalloc() failure in already existing code.
>     buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
>     if (!buffer) {
>              sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "

  Added Bart Van Assche’s Reviewed-by tag in: [3/3] scsi: sd: make sd_revalidate_disk() return void

Changes since v8:
  - Split removal of the redundant printk into its own patch (1/3),
    instead of keeping it inside the warning fix.
  - Kept the build warning fix and return type change as separate patches.
  - Updated changelogs accordingly.

Thanks

Abinash

Abinash Singh (3):
  scsi: sd: Remove redundant printk after kmalloc failure
  scsi: sd: Fix build warning in sd_revalidate_disk()
  scsi: sd: make sd_revalidate_disk() return void

 drivers/scsi/sd.c | 58 ++++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 28 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2025-08-25  2:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 18:02 [PATCH v9 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk() Abinash Singh
2025-08-24 18:02 ` [PATCH v9 1/3] scsi: sd: Remove redundant printk after kmalloc failure Abinash Singh
2025-08-25  1:56   ` Damien Le Moal
2025-08-24 18:02 ` [PATCH v9 2/3] scsi: sd: Fix build warning in sd_revalidate_disk() Abinash Singh
2025-08-25  1:53   ` Damien Le Moal
2025-08-24 18:02 ` [PATCH v9 3/3] scsi: sd: make sd_revalidate_disk() return void Abinash Singh
2025-08-25  1:58   ` Damien Le Moal

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).