[PATCH 2/3] IDE-ACPI: Delete unnecessary null pointer checks in ide_get_dev_handle()
From: SF Markus Elfring
Date: Sat Dec 26 2015 - 05:17:57 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 26 Dec 2015 10:33:48 +0100
The variable "dinfo" will contain an appropropriate pointer after a call
of the acpi_get_object_info() function succeeded.
Thus remove two safety checks.
Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/ide/ide-acpi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index 319b754..b6b2111 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -148,14 +148,14 @@ static int ide_get_dev_handle(struct device *dev, acpi_handle *handle,
DEBPRINT("get_object_info for device failed\n");
return -ENODEV;
}
- if (dinfo && (dinfo->valid & ACPI_VALID_ADR) &&
+ if ((dinfo->valid & ACPI_VALID_ADR) &&
dinfo->address == addr) {
*pcidevfn = addr;
*handle = dev_handle;
} else {
DEBPRINT("get_object_info for device has wrong "
" address: %llu, should be %u\n",
- dinfo ? (unsigned long long)dinfo->address : -1ULL,
+ (unsigned long long)dinfo->address,
(unsigned int)addr);
ret = -ENODEV;
goto free_info;
--
2.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/