mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Maninder Singh <maninder1.s@samsung.com>,
	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
Date: Thu, 25 Jun 2015 15:39:21 +0100	[thread overview]
Message-ID: <558C1299.3060405@mev.co.uk> (raw)
In-Reply-To: <1435230871-2722-1-git-send-email-maninder1.s@samsung.com>

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 <maninder1.s@samsung.com>
> Reviewed-by: Yogesh Gaur <yn.gaur@samsung.com>
> ---
> 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: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

      reply	other threads:[~2015-06-25 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 11:14 Maninder Singh
2015-06-25 14:39 ` Ian Abbott [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558C1299.3060405@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=pankaj.m@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®