From: Abinash Singh <abinashsinghlalotra@gmail.com>
To: bvanassche@acm.org
Cc: James.Bottomley@HansenPartnership.com,
abinashsinghlalotra@gmail.com, dlemoal@kernel.org,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com
Subject: [PATCH v9 1/3] scsi: sd: Remove redundant printk after kmalloc failure
Date: Sun, 24 Aug 2025 23:32:16 +0530 [thread overview]
Message-ID: <20250824180218.39498-2-abinashsinghlalotra@gmail.com> (raw)
In-Reply-To: <20250824180218.39498-1-abinashsinghlalotra@gmail.com>
The SCSI disk driver prints a warning when kmalloc() fails in
sd_revalidate_disk(). This is redundant because the page allocator
already reports failures unless __GFP_NOWARN is used. Keeping the
extra message only adds noise to the kernel log.
Remove the unnecessary sd_printk() call. Control flow is unchanged.
Fixes: e73aec824703 ("[SCSI] sd: make printing use a common prefix")
Signed-off-by: Abinash Singh <abinashsinghlalotra@gmail.com>
---
drivers/scsi/sd.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 5b8668accf8e..aa9d944e27c5 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3712,11 +3712,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
goto out;
buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
- if (!buffer) {
- sd_printk(KERN_WARNING, sdkp, "sd_revalidate_disk: Memory "
- "allocation failure.\n");
+ if (!buffer)
goto out;
- }
sd_spinup_disk(sdkp);
--
2.43.0
next prev parent reply other threads:[~2025-08-24 18:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Abinash Singh [this message]
2025-08-25 1:56 ` [PATCH v9 1/3] scsi: sd: Remove redundant printk after kmalloc failure 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250824180218.39498-2-abinashsinghlalotra@gmail.com \
--to=abinashsinghlalotra@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®