public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maninder Singh <maninder1.s@samsung.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "abbotti@mev.co.uk" <abbotti@mev.co.uk>,
	"hsweeten@visionengravers.com" <hsweeten@visionengravers.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	PANKAJ MISHRA <pankaj.m@samsung.com>
Subject: Re: [PATCH 1/1] staging/comedi: remove unnecessary check around pci_dev_put
Date: Thu, 25 Jun 2015 11:31:46 +0000 (GMT)	[thread overview]
Message-ID: <1130498471.248131435231903435.JavaMail.weblogic@ep2mlwas07c> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=windows-1252, Size: 1128 bytes --]

Hi,

>This patch is correct but the motivation is wrong.
>
>The check in pci_dev_put() is like a sanity check.  There are many
>functions which have a sanity check and many which do not, it is
>impossible for a human to remember the complete list of each.  When we
>remove explicit checks for NULL and instead rely on the sanity checks
>it sometimes makes the code more subtle and difficult to read.
>
>In this case, "pcidev" can never be NULL so the check is misleading and
>makes the code more complicated.  Removing it is a good thing.  Also
>the attach function does not have a NULL check so when we remove this
>check we make the code more consistent.
>
>But in other cases, if "pcidev" could be NULL then we should keep the
>check so that the code is easier to read.

Yes agree, I also sent this patch because there is only one call for pci_dev_put
in adl_pci9118.c, and i thoguht its good to remove check around that one.

Thanks for your feedback.
------------ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

             reply	other threads:[~2015-06-25 11:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 11:31 Maninder Singh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-25 11:13 [PATCH 1/1] staging/comedi: remove unnecessary check around pci_dev_put Maninder Singh
2015-06-25 10:50 Maninder Singh
2015-06-25 11:10 ` Sudip Mukherjee
2015-06-25 11:21 ` Dan Carpenter
2015-06-25 14:34   ` Ian Abbott

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=1130498471.248131435231903435.JavaMail.weblogic@ep2mlwas07c \
    --to=maninder1.s@samsung.com \
    --cc=abbotti@mev.co.uk \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --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