Staging: greybus: camera: cleanup multiple checks for null pointers
authorSumit Pundir <pundirsumit11@gmail.com>
Mon, 8 Jan 2018 16:50:15 +0000 (22:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jan 2018 14:38:48 +0000 (15:38 +0100)
Fixed coding style issue regarding null comparison at multiple lines.
Issue reported by checkpatch.pl

Signed-off-by: Sumit Pundir <pundirsumit11@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/camera.c

index f13f16b63d7eda31fa389093b826a6ad51cf2bd7..07ebfb88db9bc66a98c429ed0c0b44e7847a2df3 100644 (file)
@@ -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)