mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Karsten Keil <isdn@linux-pingi.de>
To: Julia Lawall <julia@diku.dk>
Cc: isdn4linux@listserv.isdn4linux.de, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 3/5] drivers/isdn: Drop unnecessary NULL test
Date: Fri, 24 Jul 2009 12:55:32 +0200	[thread overview]
Message-ID: <200907241255.33013.isdn@linux-pingi.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0907122204140.22658@ask.diku.dk>


ACK, thanks for spotting this.

I will include this in my next patchset.

Karsten

On Sonntag, 12. Juli 2009 22:05:03 Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> The result of container_of should not be NULL.  In particular, in this case
> the argument to the enclosing function has passed though INIT_WORK, which
> dereferences it, implying that its container cannot be NULL.
>
> A simplified version of the semantic patch that makes this change is as
> follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> identifier fn,work,x,fld;
> type T;
> expression E1,E2;
> statement S;
> @@
>
> static fn(struct work_struct *work) {
>   ... when != work = E1
>   x = container_of(work,T,fld)
>   ... when != x = E2
> - if (x == NULL) S
>   ...
> }
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
>  drivers/isdn/hisax/amd7930_fn.c |    2 --
>  drivers/isdn/hisax/hfc_pci.c    |    2 --
>  drivers/isdn/hisax/hfc_sx.c     |    2 --
>  drivers/isdn/hisax/icc.c        |    2 --
>  drivers/isdn/hisax/isac.c       |    2 --
>  drivers/isdn/hisax/w6692.c      |    2 --
>  6 files changed, 12 deletions(-)
...


      reply	other threads:[~2009-07-24 10:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-12 20:05 Julia Lawall
2009-07-24 10:55 ` Karsten Keil [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=200907241255.33013.isdn@linux-pingi.de \
    --to=isdn@linux-pingi.de \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome