diff options
| author | Benjamin Romer <benjamin.romer@unisys.com> | 2015-03-16 20:57:49 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-20 16:19:16 +0300 |
| commit | 3d8dbdbfeda40b8cf58abed84be1ae2231215862 (patch) | |
| tree | 4f0c74951e78fcd9f1219b491cee68a1a1945ba2 | |
| parent | c394650650b0fc91aebfef601c5a427ef387bb72 (diff) | |
| download | linux-3d8dbdbfeda40b8cf58abed84be1ae2231215862.tar.xz | |
staging: unisys: clean up NULL compares in virtpci.c
Remove unnecessary NULLs by just using the pointer value directly.
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/unisys/virtpci/virtpci.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index b169d392fce9..d5ad01783c07 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -809,7 +809,7 @@ static int virtpci_device_add(struct device *parentbus, int devtype, /* add a Virtual Device */ virtpcidev = kzalloc(sizeof(*virtpcidev), GFP_ATOMIC); - if (virtpcidev == NULL) { + if (!virtpcidev) { POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR); return 0; } @@ -1076,8 +1076,8 @@ static int virtpci_device_del(struct device *parentbus, /* see if we are to delete all - NOTE: all implies we have a * valid parentbus */ - all = ((devtype == VIRTHBA_TYPE) && (wwnn == NULL)) || - ((devtype == VIRTNIC_TYPE) && (macaddr == NULL)); + all = ((devtype == VIRTHBA_TYPE) && (!wwnn)) || + ((devtype == VIRTNIC_TYPE) && (!macaddr)); /* find all the vhba or vnic or both in virtpci device list * keep list of ones we are deleting so we can call @@ -1206,9 +1206,8 @@ int virtpci_register_driver(struct virtpci_driver *drv) { int result = 0; - if (drv->id_table == NULL) + if (!drv->id_table) return 1; - /* initialize core driver fields needed to call driver_register */ drv->core_driver.name = drv->name; /* name of driver in sysfs */ drv->core_driver.bus = &virtpci_bus_type; /* type of bus this |
