mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Abinash Singh <abinashsinghlalotra@gmail.com>,
	"James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 2/2] scsi: sd: make sd_revalidate_disk() return void
Date: Tue, 19 Aug 2025 12:24:01 -0700	[thread overview]
Message-ID: <e5186da6-e621-457a-ba7a-316e5eb5d161@acm.org> (raw)
In-Reply-To: <20250816205329.404116-3-abinashsinghlalotra@gmail.com>

On 8/16/25 1:53 PM, Abinash Singh wrote:
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index c3791746806d..ba3bfd9b00aa 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -106,7 +106,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, struct queue_limits *lim,
>   		unsigned int mode);
>   static void sd_config_write_same(struct scsi_disk *sdkp,
>   		struct queue_limits *lim);
> -static int  sd_revalidate_disk(struct gendisk *);
> +static void  sd_revalidate_disk(struct gendisk *);
>   static void sd_unlock_native_capacity(struct gendisk *disk);
>   static void sd_shutdown(struct device *);
>   static void scsi_disk_release(struct device *cdev);
> @@ -3691,7 +3691,7 @@ static void sd_read_block_zero(struct scsi_disk *sdkp)
>    *	performs disk spin up, read_capacity, etc.
>    *	@disk: struct gendisk we care about
>    **/
> -static int sd_revalidate_disk(struct gendisk *disk)
> +static void sd_revalidate_disk(struct gendisk *disk)
>   {
>   	struct scsi_disk *sdkp = scsi_disk(disk);
>   	struct scsi_device *sdp = sdkp->device;
> @@ -3709,13 +3709,13 @@ static int sd_revalidate_disk(struct gendisk *disk)
>   	 * of the other niceties.
>   	 */
>   	if (!scsi_device_online(sdp))
> -		goto out;
> +		return;
>   
>   	lim = kmalloc(sizeof(*lim), GFP_KERNEL);
>   	if (!lim) {
>   		sd_printk(KERN_WARNING, sdkp,
>   			"sd_revalidate_disk: Disk limit allocation failure.\n");
> -		goto out;
> +		return;
>   	}
>   
>   	buffer = kmalloc(SD_BUF_SIZE, GFP_KERNEL);
> @@ -3829,7 +3829,6 @@ static int sd_revalidate_disk(struct gendisk *disk)
>   	kfree(lim);
>   	kfree(buffer);
>   
> -	return err;
>   }

Shouldn't this patch remove the initializer from the 'err' variable?
Otherwise this patch looks good to me.

Bart.

      reply	other threads:[~2025-08-19 19:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16 20:53 [PATCH v7 0/2] scsi: sd: Fix build warning in sd_revalidate_disk() Abinash Singh
2025-08-16 20:53 ` [PATCH v7 1/2] " Abinash Singh
2025-08-19 19:26   ` Bart Van Assche
2025-08-16 20:53 ` [PATCH v7 2/2] scsi: sd: make sd_revalidate_disk() return void Abinash Singh
2025-08-19 19:24   ` Bart Van Assche [this message]

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=e5186da6-e621-457a-ba7a-316e5eb5d161@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=abinashsinghlalotra@gmail.com \
    --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®