Staging: comedi: drivers: Delete NULL check before pci_dev_put
authorBhumika Goyal <bhumirks@gmail.com>
Mon, 12 Sep 2016 17:32:47 +0000 (23:02 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Sep 2016 12:51:53 +0000 (14:51 +0200)
The function pci_dev_put checks whether its argument is NULL and returns
immediately. Therefore, NULL test before the call if not needed.
Found using coccinelle:
@@
expression x;
@@

- if(x)
- pci_dev_put(x);
+ pci_dev_put(x);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adl_pci9118.c

index be70bd333807afe697366f9d5e73a6bd1167ded2..86450c08f2918d461a3f073055a15653ee0a9279 100644 (file)
@@ -1693,8 +1693,7 @@ static void pci9118_detach(struct comedi_device *dev)
                pci9118_reset(dev);
        comedi_pci_detach(dev);
        pci9118_free_dma(dev);
-       if (pcidev)
-               pci_dev_put(pcidev);
+       pci_dev_put(pcidev);
 }
 
 static struct comedi_driver adl_pci9118_driver = {