Re: [PATCH v10 3/3] scsi: sd: make sd_revalidate_disk() return void
From: Damien Le Moal
Date: Tue Aug 26 2025 - 01:10:14 EST
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@xxxxxxx>
> Reviewed-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
> Signed-off-by: Abinash Singh <abinashsinghlalotra@xxxxxxxxx>
[...]
> 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