mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Sumit Pundir <pundirsumit11@gmail.com>, johan@kernel.org
Cc: devel@driverdev.osuosl.org, elder@kernel.org,
	linux-kernel@vger.kernel.org, greybus-dev@lists.linaro.org
Subject: Re: [greybus-dev] [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers
Date: Mon, 8 Jan 2018 11:44:46 -0600	[thread overview]
Message-ID: <14aa0ddb-8600-a0af-5d42-ed5be55c27f1@linaro.org> (raw)
In-Reply-To: <1515430215-8826-1-git-send-email-pundirsumit11@gmail.com>

On 01/08/2018 10:50 AM, Sumit Pundir wrote:
> Fixed coding style issue regarding null comparison at multiple lines.
> Issue reported by checkpatch.pl
> 
> Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>

Looks good.  The subject should say "staging" rather than "Staging" 
but that's probably not a big deal.

Reviewed-by: Alex Elder <elder@linaro.org>

> ---
> v2:
>  Updated the patch title and description.
> 
>  drivers/staging/greybus/camera.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c
> index f13f16b..07ebfb8 100644
> --- a/drivers/staging/greybus/camera.c
> +++ b/drivers/staging/greybus/camera.c
> @@ -918,7 +918,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
>  
>  	/* Retrieve number of streams to configure */
>  	token = strsep(&buf, ";");
> -	if (token == NULL)
> +	if (!token)
>  		return -EINVAL;
>  
>  	ret = kstrtouint(token, 10, &nstreams);
> @@ -929,7 +929,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
>  		return -EINVAL;
>  
>  	token = strsep(&buf, ";");
> -	if (token == NULL)
> +	if (!token)
>  		return -EINVAL;
>  
>  	ret = kstrtouint(token, 10, &flags);
> @@ -946,7 +946,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
>  
>  		/* width */
>  		token = strsep(&buf, ";");
> -		if (token == NULL) {
> +		if (!token) {
>  			ret = -EINVAL;
>  			goto done;
>  		}
> @@ -956,7 +956,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
>  
>  		/* height */
>  		token = strsep(&buf, ";");
> -		if (token == NULL)
> +		if (!token)
>  			goto done;
>  
>  		ret = kstrtouint(token, 10, &stream->height);
> @@ -965,7 +965,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
>  
>  		/* Image format code */
>  		token = strsep(&buf, ";");
> -		if (token == NULL)
> +		if (!token)
>  			goto done;
>  
>  		ret = kstrtouint(token, 16, &stream->format);
> @@ -1009,7 +1009,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
>  
>  	/* Request id */
>  	token = strsep(&buf, ";");
> -	if (token == NULL)
> +	if (!token)
>  		return -EINVAL;
>  	ret = kstrtouint(token, 10, &request_id);
>  	if (ret < 0)
> @@ -1017,7 +1017,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
>  
>  	/* Stream mask */
>  	token = strsep(&buf, ";");
> -	if (token == NULL)
> +	if (!token)
>  		return -EINVAL;
>  	ret = kstrtouint(token, 16, &streams_mask);
>  	if (ret < 0)
> @@ -1025,7 +1025,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
>  
>  	/* number of frames */
>  	token = strsep(&buf, ";");
> -	if (token == NULL)
> +	if (!token)
>  		return -EINVAL;
>  	ret = kstrtouint(token, 10, &num_frames);
>  	if (ret < 0)
> 

  reply	other threads:[~2018-01-08 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 16:50 Sumit Pundir
2018-01-08 17:44 ` Alex Elder [this message]
2018-01-09  9:36 ` Johan Hovold

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=14aa0ddb-8600-a0af-5d42-ed5be55c27f1@linaro.org \
    --to=elder@linaro.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=elder@kernel.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pundirsumit11@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®