public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>,
	knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	gregkh@linuxfoundation.org, ciorneiioana@gmail.com,
	cristina.moraru09@gmail.com, dan.carpenter@oracle.com,
	josselin.costanzi@mobile-devices.fr
Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] Staging: iio: accel: Fixed NULL comparison style
Date: Sat, 19 Dec 2015 16:41:25 +0000	[thread overview]
Message-ID: <567588B5.9000004@kernel.org> (raw)
In-Reply-To: <20151213151513.GA5059@Karyakshetra>

On 13/12/15 15:15, Bhaktipriya Shridhar wrote:
> The variable u8 **rx_p, is a pointer-to-pointer and hence the check
> should
> be "if (!*rx_p)" and not "if (!rx_p)".
> In the earlier version, checkpatch.pl gave the following check, which
> was incorrect:
> CHECK: Comparison to NULL could be written "!rx_p"
> +       if (*rx_p == NULL) {
> 
> Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Applied to the togreg branch of iio.git with the addition of the driver name
in the patch title.

Thanks

Jonathan
> ---
>  Changes in v3:
>         - Replaced "if (!rx_p)" with "if (!*rx_p)"
> 	- Changes are made on the original code
> 
>  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..1920dc60 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;
>  	}
> 


      reply	other threads:[~2015-12-19 16:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-13 15:15 [PATCH v3] Staging: iio: accel: Fixed NULL comparison style Bhaktipriya Shridhar
2015-12-19 16:41 ` Jonathan Cameron [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=567588B5.9000004@kernel.org \
    --to=jic23@kernel.org \
    --cc=bhaktipriya96@gmail.com \
    --cc=ciorneiioana@gmail.com \
    --cc=cristina.moraru09@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --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