Skip to contentSkip to conversation

ata: Fix acpi_bus_get_device() return value check

PATCH New Yijing Wang 1 participant 1 message Nov 25, 2013 libata

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ata: Fix acpi_bus_get_device() return value check

Since acpi_bus_get_device() returns plain int and not acpi_status, ACPI_FAILURE() should not be used for checking its return value. Fix that.

---
v1->v2: remove the unused variable status found by linux-next kbuild test.

---
 drivers/ata/libata-zpodd.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/ata/libata-zpodd.c +1 -3
index 68f9e32..88949c6 100644
@@ -88,15 +88,13 @@ static enum odd_mech_type zpodd_get_mech_type(struct ata_device *dev)
 static bool odd_can_poweroff(struct ata_device *ata_dev)
 {
 	acpi_handle handle;
-	acpi_status status;
 	struct acpi_device *acpi_dev;
 
 	handle = ata_dev_acpi_handle(ata_dev);
 	if (!handle)
 		return false;
 
-	status = acpi_bus_get_device(handle, &acpi_dev);
-	if (ACPI_FAILURE(status))
+	if (acpi_bus_get_device(handle, &acpi_dev))
 		return false;
 
 	return acpi_device_can_poweroff(acpi_dev);
Signature · 1 line
1.7.1