]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: libsas: Simplify sas_ata_wait_eh()
authorDamien Le Moal <dlemoal@kernel.org>
Fri, 25 Jul 2025 01:58:15 +0000 (10:58 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Jul 2025 13:03:56 +0000 (09:03 -0400)
Simplify the code of sas_ata_wait_eh(), removing the local variable ap
for the pointer to the device ata_port structure. The test using
dev_is_sata() is also removed as all call sites of this function check if
the device is a SATA one before calling this function.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20250725015818.171252-3-dlemoal@kernel.org
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libsas/sas_ata.c

index 7b4e7a61965a2bab311c6606decd0b3d9d116df5..2cbf38b18c5c309b48aca9e8fd30ea6f95bc6b1b 100644 (file)
@@ -927,13 +927,7 @@ EXPORT_SYMBOL_GPL(sas_ata_schedule_reset);
 
 void sas_ata_wait_eh(struct domain_device *dev)
 {
-       struct ata_port *ap;
-
-       if (!dev_is_sata(dev))
-               return;
-
-       ap = dev->sata_dev.ap;
-       ata_port_wait_eh(ap);
+       ata_port_wait_eh(dev->sata_dev.ap);
 }
 
 void sas_ata_device_link_abort(struct domain_device *device, bool force_reset)