Commit b5c54c45 authored by Sumit Pundir's avatar Sumit Pundir Committed by Greg Kroah-Hartman

Staging: greybus: camera: cleanup multiple checks for null pointers

Fixed coding style issue regarding null comparison at multiple lines.
Issue reported by checkpatch.pl
Signed-off-by: default avatarSumit Pundir <pundirsumit11@gmail.com>
Acked-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e4e179a8
...@@ -918,7 +918,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, ...@@ -918,7 +918,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
/* Retrieve number of streams to configure */ /* Retrieve number of streams to configure */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
return -EINVAL; return -EINVAL;
ret = kstrtouint(token, 10, &nstreams); ret = kstrtouint(token, 10, &nstreams);
...@@ -929,7 +929,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, ...@@ -929,7 +929,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
return -EINVAL; return -EINVAL;
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
return -EINVAL; return -EINVAL;
ret = kstrtouint(token, 10, &flags); ret = kstrtouint(token, 10, &flags);
...@@ -946,7 +946,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, ...@@ -946,7 +946,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
/* width */ /* width */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) { if (!token) {
ret = -EINVAL; ret = -EINVAL;
goto done; goto done;
} }
...@@ -956,7 +956,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, ...@@ -956,7 +956,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
/* height */ /* height */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
goto done; goto done;
ret = kstrtouint(token, 10, &stream->height); ret = kstrtouint(token, 10, &stream->height);
...@@ -965,7 +965,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam, ...@@ -965,7 +965,7 @@ static ssize_t gb_camera_debugfs_configure_streams(struct gb_camera *gcam,
/* Image format code */ /* Image format code */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
goto done; goto done;
ret = kstrtouint(token, 16, &stream->format); ret = kstrtouint(token, 16, &stream->format);
...@@ -1009,7 +1009,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, ...@@ -1009,7 +1009,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
/* Request id */ /* Request id */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
return -EINVAL; return -EINVAL;
ret = kstrtouint(token, 10, &request_id); ret = kstrtouint(token, 10, &request_id);
if (ret < 0) if (ret < 0)
...@@ -1017,7 +1017,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, ...@@ -1017,7 +1017,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
/* Stream mask */ /* Stream mask */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
return -EINVAL; return -EINVAL;
ret = kstrtouint(token, 16, &streams_mask); ret = kstrtouint(token, 16, &streams_mask);
if (ret < 0) if (ret < 0)
...@@ -1025,7 +1025,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam, ...@@ -1025,7 +1025,7 @@ static ssize_t gb_camera_debugfs_capture(struct gb_camera *gcam,
/* number of frames */ /* number of frames */
token = strsep(&buf, ";"); token = strsep(&buf, ";");
if (token == NULL) if (!token)
return -EINVAL; return -EINVAL;
ret = kstrtouint(token, 10, &num_frames); ret = kstrtouint(token, 10, &num_frames);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment