diff mbox series

[4/6] scsi: sd: Move the scsi_disk_release() function definition

Message ID 20240730210042.266504-5-bvanassche@acm.org (mailing list archive)
State Superseded
Headers show
Series SCSI disk source code cleanup | expand

Commit Message

Bart Van Assche July 30, 2024, 9 p.m. UTC
Move the scsi_disk_release() function definition such that its forward
declaration can be removed.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/sd.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

Comments

Damien Le Moal July 30, 2024, 11:43 p.m. UTC | #1
On 7/31/24 06:00, Bart Van Assche wrote:
> Move the scsi_disk_release() function definition such that its forward
> declaration can be removed.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 30c1792df1b3..cefc40de6ee8 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -105,7 +105,6 @@  MODULE_ALIAS_SCSI_DEVICE(TYPE_ZBC);
 
 static int  sd_revalidate_disk(struct gendisk *);
 static void sd_unlock_native_capacity(struct gendisk *disk);
-static void scsi_disk_release(struct device *cdev);
 
 static DEFINE_IDA(sd_index_ida);
 
@@ -792,6 +791,17 @@  static struct attribute *sd_disk_attrs[] = {
 };
 ATTRIBUTE_GROUPS(sd_disk);
 
+static void scsi_disk_release(struct device *dev)
+{
+	struct scsi_disk *sdkp = to_scsi_disk(dev);
+
+	ida_free(&sd_index_ida, sdkp->index);
+	put_device(&sdkp->device->sdev_gendev);
+	free_opal_dev(sdkp->opal_dev);
+
+	kfree(sdkp);
+}
+
 static struct class sd_disk_class = {
 	.name		= "scsi_disk",
 	.dev_release	= scsi_disk_release,
@@ -4037,17 +4047,6 @@  static int sd_probe(struct device *dev)
 	return error;
 }
 
-static void scsi_disk_release(struct device *dev)
-{
-	struct scsi_disk *sdkp = to_scsi_disk(dev);
-
-	ida_free(&sd_index_ida, sdkp->index);
-	put_device(&sdkp->device->sdev_gendev);
-	free_opal_dev(sdkp->opal_dev);
-
-	kfree(sdkp);
-}
-
 static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
 {
 	unsigned char cmd[6] = { START_STOP };	/* START_VALID */