From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>,
Joe Perches <joe@perches.com>
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
ciorneiioana@gmail.com, cristina.moraru09@gmail.com,
josselin.costanzi@mobile-devices.fr, linux-iio@vger.kernel.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: iio: accel: Fixed NULL comparison style
Date: Sun, 13 Dec 2015 14:07:44 +0300 [thread overview]
Message-ID: <20151213110744.GC5177@mwanda> (raw)
In-Reply-To: <20151213095427.GA6159@Karyakshetra>
On Sun, Dec 13, 2015 at 12:54:27PM +0300, Bhaktipriya Shridhar wrote:
> This patch fixes checkpatch.pl check:
> CHECK: Comparison to NULL could be written "!rx_p"
> + if (*rx_p == NULL) {
>
Actually it should be "if (!*rx_p)". checkpatch.pl appears to have a
bug here.
regards,
dan carpenter
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
> ---
> drivers/staging/iio/accel/sca3000_ring.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/accel/sca3000_ring.c b/drivers/staging/iio/accel/sca3000_ring.c
> index 20b878d..5339b10 100644
> --- a/drivers/staging/iio/accel/sca3000_ring.c
> +++ b/drivers/staging/iio/accel/sca3000_ring.c
> @@ -48,7 +48,7 @@ static int sca3000_read_data(struct sca3000_state *st,
> }
> };
> *rx_p = kmalloc(len, GFP_KERNEL);
> - if (*rx_p == NULL) {
> + if (!rx_p) {
> ret = -ENOMEM;
> goto error_ret;
> }
> --
> 2.1.4
prev parent reply other threads:[~2015-12-13 11:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-13 9:54 [PATCH] Staging: iio: accel: Fixed NULL comparison style Bhaktipriya Shridhar
2015-12-13 11:07 ` Dan Carpenter [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=20151213110744.GC5177@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bhaktipriya96@gmail.com \
--cc=ciorneiioana@gmail.com \
--cc=cristina.moraru09@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=joe@perches.com \
--cc=josselin.costanzi@mobile-devices.fr \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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