Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbbFYOjc (ORCPT ); Thu, 25 Jun 2015 10:39:32 -0400 Received: from smtp65.iad3a.emailsrvr.com ([173.203.187.65]:59104 "EHLO smtp65.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751324AbbFYOjY (ORCPT ); Thu, 25 Jun 2015 10:39:24 -0400 X-Sender-Id: abbotti@mev.co.uk Message-ID: <558C1299.3060405@mev.co.uk> Date: Thu, 25 Jun 2015 15:39:21 +0100 From: Ian Abbott User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Maninder Singh , hsweeten@visionengravers.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org CC: pankaj.m@samsung.com Subject: Re: [PATCH v2] staging/comedi: remove unnecessary check around pci_dev_put References: <1435230871-2722-1-git-send-email-maninder1.s@samsung.com> In-Reply-To: <1435230871-2722-1-git-send-email-maninder1.s@samsung.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1437 Lines: 39 On 25/06/15 12:14, Maninder Singh wrote: > pci_dev_put checks for NULL pointer itself, > reported by coccinelle > > Signed-off-by: Maninder Singh > Reviewed-by: Yogesh Gaur > --- > v2: changelog typo cehcks -> checks > > drivers/staging/comedi/drivers/adl_pci9118.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c > index fb3043d..19b5806 100644 > --- a/drivers/staging/comedi/drivers/adl_pci9118.c > +++ b/drivers/staging/comedi/drivers/adl_pci9118.c > @@ -1717,8 +1717,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 = { > The patch does no harm, but as mentioned by Dan Carpenter, if pcidev could be NULL (which it could be), we should keep the test for readability. -- -=( Ian Abbott @ MEV Ltd. E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/