* [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers
@ 2018-01-08 16:50 Sumit Pundir
2018-01-08 17:44 ` [greybus-dev] " Alex Elder
2018-01-09 9:36 ` Johan Hovold
0 siblings, 2 replies; 3+ messages in thread
From: Sumit Pundir @ 2018-01-08 16:50 UTC (permalink / raw)
To: johan; +Cc: elder, gregkh, greybus-dev, devel, linux-kernel
Fixed coding style issue regarding null comparison at multiple lines.
Issue reported by checkpatch.pl
Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
---
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)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [greybus-dev] [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers
2018-01-08 16:50 [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers Sumit Pundir
@ 2018-01-08 17:44 ` Alex Elder
2018-01-09 9:36 ` Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: Alex Elder @ 2018-01-08 17:44 UTC (permalink / raw)
To: Sumit Pundir, johan; +Cc: devel, elder, linux-kernel, greybus-dev
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)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers
2018-01-08 16:50 [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers Sumit Pundir
2018-01-08 17:44 ` [greybus-dev] " Alex Elder
@ 2018-01-09 9:36 ` Johan Hovold
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hovold @ 2018-01-09 9:36 UTC (permalink / raw)
To: Sumit Pundir; +Cc: johan, elder, gregkh, greybus-dev, devel, linux-kernel
On Mon, Jan 08, 2018 at 10:20:15PM +0530, 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>
> ---
> v2:
> Updated the patch title and description.
Thanks for the update.
Acked-by: Johan Hovold <johan@kernel.org>
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-09 9:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-08 16:50 [PATCH v2] Staging: greybus: camera: cleanup multiple checks for null pointers Sumit Pundir
2018-01-08 17:44 ` [greybus-dev] " Alex Elder
2018-01-09 9:36 ` Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox