From: Julia Lawall <julia.lawall@lip6.fr>
To: Greg KH <greg@kroah.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Meghana Madhyastha <meghana.madhyastha@gmail.com>,
outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: irda: drivers: Replace (skb == NULL) with (!skb)
Date: Mon, 18 Sep 2017 11:48:33 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1709181148160.6136@hadrien> (raw)
In-Reply-To: <20170918094843.GA24318@kroah.com>
On Mon, 18 Sep 2017, Greg KH wrote:
> On Fri, Sep 15, 2017 at 12:42:42PM +0200, Julia Lawall wrote:
> >
> >
> > On Fri, 15 Sep 2017, Meghana Madhyastha wrote:
> >
> > > Some functions return NULL as an indication of failure.
> > > The style (!skb) is more common than (skb == NULL) for these
> > > functions.
> > >
> > > Found by the following Coccinelle script.
> > >
> > > @@
> > > identifier i;
> > > statement S;
> > > @@
> > >
> > > i = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|usb_alloc_urb\|
> > > alloc_netdev\|dev_alloc_skb\)(...));
> > >
> > > (
> > > -if (i == NULL)
> > > +if (!i)
> > > S
> >
> > If you provide just this option, Coccinelle should expand your rule to
> > consider the other option as well.
> >
> > You can see the section on isomorphisms in the Coccinelle tutorial.
> >
> > > |
> > > -if (NULL == i)
> > > +if (!i)
> > > S
> > > )
> > >
> > > Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
> >
> > Acked-by: drivers/staging/irda/drivers/ali-ircc.c
>
> Odd acked-by signature :)
Oops :)
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170918094843.GA24318%40kroah.com.
> For more options, visit https://groups.google.com/d/optout.
>
prev parent reply other threads:[~2017-09-18 9:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 9:13 [PATCH] Staging: irda: drivers: Replace (skb == NULL) with (!skb) Meghana Madhyastha
2017-09-15 10:42 ` [Outreachy kernel] " Julia Lawall
2017-09-18 9:48 ` Greg KH
2017-09-18 9:48 ` Julia Lawall [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=alpine.DEB.2.20.1709181148160.6136@hadrien \
--to=julia.lawall@lip6.fr \
--cc=greg@kroah.com \
--cc=meghana.madhyastha@gmail.com \
--cc=outreachy-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.