All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: 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:43 +0200	[thread overview]
Message-ID: <20170918094843.GA24318@kroah.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1709151240450.3146@hadrien>

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 :)



  reply	other threads:[~2017-09-18  9:48 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 [this message]
2017-09-18  9:48     ` Julia Lawall

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=20170918094843.GA24318@kroah.com \
    --to=greg@kroah.com \
    --cc=julia.lawall@lip6.fr \
    --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.