From: Bhumika Goyal Date: Mon, 12 Sep 2016 17:32:47 +0000 (+0530) Subject: Staging: comedi: drivers: Delete NULL check before pci_dev_put X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=25b80dbe3fa6d76d8f19af0623d1fd8ed0dd671e;p=openwrt%2Fstaging%2Fblogic.git Staging: comedi: drivers: Delete NULL check before pci_dev_put 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index be70bd333807..86450c08f291 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -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 = {