From: Damien Le Moal <dlemoal@kernel.org>
To: Abinash Singh <abinashsinghlalotra@gmail.com>, bvanassche@acm.org
Cc: James.Bottomley@HansenPartnership.com,
linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
martin.petersen@oracle.com
Subject: Re: [PATCH v10 3/3] scsi: sd: make sd_revalidate_disk() return void
Date: Tue, 26 Aug 2025 14:10:03 +0900 [thread overview]
Message-ID: <a618bb76-af82-4b47-a68c-8fc83cad97cb@kernel.org> (raw)
In-Reply-To: <20250825183940.13211-4-abinashsinghlalotra@gmail.com>
On 8/26/25 03:39, Abinash Singh wrote:
> The sd_revalidate_disk() function currently returns 0 for
> both success and memory allocation failure.Since none of its
> callers use the return value, this return code is both unnecessary
> and potentially misleading.
>
> Change the return type of sd_revalidate_disk() from int to void
> and remove all return value handling. This makes the function
> semantics clearer and avoids confusion about unused return codes.
>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> Signed-off-by: Abinash Singh <abinashsinghlalotra@gmail.com>
[...]
> lim = kmalloc(sizeof(*lim), GFP_KERNEL);
> if (!lim)
> - goto out;
> + return;
>
> buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
> if (!buffer)
> @@ -3823,7 +3823,6 @@ static int sd_revalidate_disk(struct gendisk *disk)
> kfree(buffer);
> kfree(lim);
>
Nit: please delete the blank line above too.
> - return err;
> }
>
> /**
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-08-26 5:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 18:39 [PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk() Abinash Singh
2025-08-25 18:39 ` [PATCH v10 1/3] scsi: sd: Fix build warning " Abinash Singh
2025-08-26 5:10 ` Damien Le Moal
2025-08-25 18:39 ` [PATCH v10 2/3] scsi: sd: Remove redundant printk after kmalloc failure Abinash Singh
2025-08-25 19:26 ` Bart Van Assche
2025-08-25 18:39 ` [PATCH v10 3/3] scsi: sd: make sd_revalidate_disk() return void Abinash Singh
2025-08-26 5:10 ` Damien Le Moal [this message]
2025-08-31 1:19 ` [PATCH v10 0/3] scsi: sd: Cleanups and warning fixes in sd_revalidate_disk() Martin K. Petersen
2025-09-10 3:04 ` Martin K. Petersen
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=a618bb76-af82-4b47-a68c-8fc83cad97cb@kernel.org \
--to=dlemoal@kernel.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=abinashsinghlalotra@gmail.com \
--cc=bvanassche@acm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.