[PATCH 2/3] IDE-ACPI: Delete unnecessary null pointer checks in ide_get_dev_handle()

SF Markus Elfring
2015-12-26T10:17:35Z

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@users.sourceforge.net>
---
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