From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Varun Wadekar <vwadekar@nvidia.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Kukjin Kim <kgene.kim@samsung.com>,
"jhbird.choi@samsung.com" <jhbird.choi@samsung.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] mtd: s3c2410 nand: Remove uncessary null check
Date: Thu, 21 Jul 2011 18:10:20 +0100 [thread overview]
Message-ID: <20110721171020.GE20310@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4E27CD14.4090702@nvidia.com>
On Thu, Jul 21, 2011 at 12:24:12PM +0530, Varun Wadekar wrote:
> On Thursday 21 July 2011 12:03 PM, jhbird.choi@samsung.com wrote:
> > From: Jonghwan Choi <jhbird.choi@samsung.com>
> >
> > clk_get() return a pointer to the struct clk or an ERR_PTR().
> >
> > Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
> > ---
> > drivers/mtd/nand/s3c2410.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
> > index 4405468..18ff2f5 100644
> > --- a/drivers/mtd/nand/s3c2410.c
> > +++ b/drivers/mtd/nand/s3c2410.c
> > @@ -723,7 +723,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
> >
> > /* free the common resources */
> >
> > - if (info->clk != NULL && !IS_ERR(info->clk)) {
> > + if (!IS_ERR(info->clk)) {
>
> I think you should use IS_ERR_OR_NULL instead.
No. Jonghwan Choi's patch is correct.
As per the patch description, the only error value which a driver can
attribute any problem with is something which passes IS_ERR(). Everything
else the driver must treat as a _valid_ struct clk - and the clk API
implementation must accept non-IS_ERR() clk_get() values.
next prev parent reply other threads:[~2011-07-21 17:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 6:33 [PATCH] mtd: s3c2410 nand: Remove uncessary null check jhbird.choi
2011-07-21 6:54 ` Varun Wadekar
2011-07-21 17:10 ` Russell King - ARM Linux [this message]
2011-07-22 8:27 ` Artem Bityutskiy
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=20110721171020.GE20310@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=jhbird.choi@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=vwadekar@nvidia.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