From: Wolfram Sang <w.sang@pengutronix.de>
To: rtc-linux@googlegroups.com
Cc: p_gortmaker@yahoo.com, a.zummo@towertech.it,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [rtc-linux] [PATCH 7/9] drivers/rtc: correct error-handling code
Date: Tue, 28 Jul 2009 18:31:04 +0200 [thread overview]
Message-ID: <20090728163104.GA15033@pengutronix.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0907281755000.28189@ask.diku.dk>
[-- Attachment #1: Type: text/plain, Size: 930 bytes --]
On Tue, Jul 28, 2009 at 05:55:33PM +0200, Julia Lawall wrote:
>
> From: Julia Lawall <julia@diku.dk>
>
> This code is not executed before ds1307->rtc has been successfully
> initialized to the result of calling rtc_device_register. Thus the test
> that ds1307->rtc is not NULL is always true.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @match exists@
> expression x, E;
> statement S1, S2;
> @@
>
> x = rtc_device_register(...)
> ... when != x = E
> (
> * if (x == NULL || ...) S1 else S2
> |
> * if (x == NULL && ...) S1 else S2
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-07-28 17:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-28 15:55 Julia Lawall
2009-07-28 16:31 ` Wolfram Sang [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=20090728163104.GA15033@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=a.zummo@towertech.it \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p_gortmaker@yahoo.com \
--cc=rtc-linux@googlegroups.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®