Commit e5f4a331 authored by Rickard Strandqvist's avatar Rickard Strandqvist Committed by Greg Kroah-Hartman

staging: unisys: virtpci: virtpci.c: Removes unnecessary NULL check

It is impossible for dprivate to ever be NULL, no check required.
Signed-off-by: default avatarRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d7462ca0
...@@ -1338,18 +1338,13 @@ static ssize_t virtpci_driver_attr_show(struct kobject *kobj, ...@@ -1338,18 +1338,13 @@ static ssize_t virtpci_driver_attr_show(struct kobject *kobj,
ssize_t ret = 0; ssize_t ret = 0;
struct driver_private *dprivate = to_driver(kobj); struct driver_private *dprivate = to_driver(kobj);
struct device_driver *driver; struct device_driver *driver = dprivate->driver;
if (dprivate != NULL)
driver = dprivate->driver;
else
driver = NULL;
DBGINF("In virtpci_driver_attr_show driver->name:%s\n", driver->name); DBGINF("In virtpci_driver_attr_show driver->name:%s\n", driver->name);
if (driver) {
if (dattr->show) if (dattr->show)
ret = dattr->show(driver, buf); ret = dattr->show(driver, buf);
}
return ret; return ret;
} }
...@@ -1361,19 +1356,13 @@ static ssize_t virtpci_driver_attr_store(struct kobject *kobj, ...@@ -1361,19 +1356,13 @@ static ssize_t virtpci_driver_attr_store(struct kobject *kobj,
ssize_t ret = 0; ssize_t ret = 0;
struct driver_private *dprivate = to_driver(kobj); struct driver_private *dprivate = to_driver(kobj);
struct device_driver *driver; struct device_driver *driver = dprivate->driver;
if (dprivate != NULL)
driver = dprivate->driver;
else
driver = NULL;
DBGINF("In virtpci_driver_attr_store driver->name:%s\n", driver->name); DBGINF("In virtpci_driver_attr_store driver->name:%s\n", driver->name);
if (driver) {
if (dattr->store) if (dattr->store)
ret = dattr->store(driver, buf, count); ret = dattr->store(driver, buf, count);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment