From: viresh kumar <viresh.kumar2@arm.com>
To: Julia Lawall <Julia.Lawall@lip6.fr>,
Shiraz Hashim <shiraz.hashim@st.com>
Cc: spear-devel <spear-devel@list.st.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Stefan Roese <sr@denx.de>, David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer
Date: Wed, 11 Jul 2012 10:01:57 +0100 [thread overview]
Message-ID: <4FFD4105.4050504@arm.com> (raw)
In-Reply-To: <1341997118-25042-1-git-send-email-Julia.Lawall@lip6.fr>
Adding spear-devel mailing list in cc.
@Shiraz: Can you update ST's mailing list address in entire MAINTAINERS file, so
that people can include ST's list easily?
On 11/07/12 09:58, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> dev_get_platdata returns a pointer, so the failure value would be NULL
> rather than a negative integer.
>
> The semantic match that finds this problem is: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression x,e;
> statement S1,S2;
> @@
>
> *x = dev_get_platdata(...)
> ... when != x = e
> *if (x < 0) S1 else S2
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> drivers/mtd/devices/spear_smi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
> index b85f183..7c10466 100644
> --- a/drivers/mtd/devices/spear_smi.c
> +++ b/drivers/mtd/devices/spear_smi.c
> @@ -935,7 +935,7 @@ static int __devinit spear_smi_probe(struct platform_device *pdev)
> }
> } else {
> pdata = dev_get_platdata(&pdev->dev);
> - if (pdata < 0) {
> + if (!pdata) {
> ret = -ENODEV;
> dev_err(&pdev->dev, "no platform data\n");
> goto err;
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
--
Viresh
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2012-07-11 9:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 8:58 [PATCH] drivers/mtd/devices/spear_smi.c: failure test for null rather than negative integer Julia Lawall
2012-07-11 9:01 ` viresh kumar [this message]
2012-07-16 9:38 ` Stefan Roese
2012-08-17 10:03 ` 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=4FFD4105.4050504@arm.com \
--to=viresh.kumar2@arm.com \
--cc=Julia.Lawall@lip6.fr \
--cc=dwmw2@infradead.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=shiraz.hashim@st.com \
--cc=spear-devel@list.st.com \
--cc=sr@denx.de \
/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;
as well as URLs for NNTP newsgroup(s).