From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bhanusree Pola <bhanusreemahesh@gmail.com>
Cc: outreachy-kernel@googlegroups.com,
Gao Xiang <gaoxiang25@huawei.com>, Chao Yu <yuchao0@huawei.com>
Subject: Re: [PATCH v2] Staging: erofs: Use !x in place of NULL comparision
Date: Thu, 21 Mar 2019 20:13:03 +0100 [thread overview]
Message-ID: <20190321191303.GA6252@kroah.com> (raw)
In-Reply-To: <20190321152007.5726-1-bhanusreemahesh@gmail.com>
On Thu, Mar 21, 2019 at 08:50:07PM +0530, Bhanusree Pola wrote:
> Test for NULL as !x instead of NULL comparisions.
> Issue found using coccinelle
> Semantic patch used to solve the problem is as follows
>
> // <smpl>
> @@
> expression x;
> statement S;
> @@
>
> x = (\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap\|
> usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\)(...));
>
> -if(x==NULL)
> +if(!x)
> S
>
> @@
> expression e;
> @@
>
> -e == NULL
> +!e
> // </smpl>
>
> Signed-off-by: Bhanusree Pola <bhanusreemahesh@gmail.com>
> ---
>
> v2:
> -modified commit log.
> -All NULL comparisions in erofs are modified.
This patch does not apply to my staging-testing branch. Please rebase
it and resend, thanks.
greg k-h
next prev parent reply other threads:[~2019-03-21 19:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-21 15:20 [PATCH v2] Staging: erofs: Use !x in place of NULL comparision Bhanusree Pola
2019-03-21 19:13 ` Greg Kroah-Hartman [this message]
2019-03-22 1:22 ` Gao Xiang
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=20190321191303.GA6252@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=bhanusreemahesh@gmail.com \
--cc=gaoxiang25@huawei.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=yuchao0@huawei.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.