staging: media: atomisp: Replace NULL comparison.
authorVarsha Rao <rvarsha016@gmail.com>
Sat, 4 Mar 2017 17:24:09 +0000 (22:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Mar 2017 10:17:41 +0000 (11:17 +0100)
Replaced x == NULL with !x, by using the following coccinelle script:

@disable is_null@
expression e;
@@

-e==NULL
+!e

This patch fixes the checkpatch issue.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/i2c/gc0310.c
drivers/staging/media/atomisp/i2c/gc2235.c
drivers/staging/media/atomisp/i2c/ov2680.c
drivers/staging/media/atomisp/i2c/ov2722.c

index a865c76..bf8b245 100644 (file)
@@ -294,7 +294,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
        unsigned int vert_blanking;
        unsigned int sh_delay;
 
-       if (info == NULL)
+       if (!info)
                return -EINVAL;
 
        /* pixel clock calculattion */
@@ -803,7 +803,7 @@ static int power_up(struct v4l2_subdev *sd)
        int ret;
 
        pr_info("%s S\n", __func__);
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -848,7 +848,7 @@ static int power_down(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -996,7 +996,7 @@ static int gc0310_set_fmt(struct v4l2_subdev *sd,
                return -EINVAL;
 
        gc0310_info = v4l2_get_subdev_hostdata(sd);
-       if (gc0310_info == NULL)
+       if (!gc0310_info)
                return -EINVAL;
 
        mutex_lock(&dev->input_lock);
@@ -1159,7 +1159,7 @@ static int gc0310_s_config(struct v4l2_subdev *sd,
        int ret = 0;
 
        pr_info("%s S\n", __func__);
-       if (platform_data == NULL)
+       if (!platform_data)
                return -ENODEV;
 
        dev->platform_data =
index 3df1ac6..aa7fc0e 100644 (file)
@@ -250,7 +250,7 @@ static int gc2235_get_intg_factor(struct i2c_client *client,
        u16 reg_val, reg_val_h, dummy;
        int ret;
 
-       if (info == NULL)
+       if (!info)
                return -EINVAL;
 
        /* pixel clock calculattion */
@@ -596,7 +596,7 @@ static int power_up(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -640,7 +640,7 @@ static int power_down(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -789,7 +789,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd,
        int idx;
 
        gc2235_info = v4l2_get_subdev_hostdata(sd);
-       if (gc2235_info == NULL)
+       if (!gc2235_info)
                return -EINVAL;
        if (format->pad)
                return -EINVAL;
@@ -908,7 +908,7 @@ static int gc2235_s_config(struct v4l2_subdev *sd,
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (platform_data == NULL)
+       if (!platform_data)
                return -ENODEV;
 
        dev->platform_data =
index e9a159f..99ae746 100644 (file)
@@ -323,7 +323,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
        u16 reg_val;
        int ret;
        ov2680_debug(dev,  "++++ov2680_get_intg_factor\n");
-       if (info == NULL)
+       if (!info)
                return -EINVAL;
 
        /* pixel clock */
@@ -899,7 +899,7 @@ static int power_up(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -948,7 +948,7 @@ static int power_down(struct v4l2_subdev *sd)
 
        h_flag = 0;
        v_flag = 0;
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -1077,7 +1077,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
                return -EINVAL;
 
        ov2680_info = v4l2_get_subdev_hostdata(sd);
-       if (ov2680_info == NULL)
+       if (!ov2680_info)
                return -EINVAL;
 
        mutex_lock(&dev->input_lock);
@@ -1233,7 +1233,7 @@ static int ov2680_s_config(struct v4l2_subdev *sd,
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (platform_data == NULL)
+       if (!platform_data)
                return -ENODEV;
 
        dev->platform_data =
index 1c0b12c..f817512 100644 (file)
@@ -295,7 +295,7 @@ static int ov2722_get_intg_factor(struct i2c_client *client,
        u16 reg_val;
        int ret;
 
-       if (info == NULL)
+       if (!info)
                return -EINVAL;
 
        dev = to_ov2722_sensor(sd);
@@ -699,7 +699,7 @@ static int power_up(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -746,7 +746,7 @@ static int power_down(struct v4l2_subdev *sd)
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (NULL == dev->platform_data) {
+       if (!dev->platform_data) {
                dev_err(&client->dev,
                        "no camera_sensor_platform_data");
                return -ENODEV;
@@ -893,7 +893,7 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
        if (!fmt)
                return -EINVAL;
        ov2722_info = v4l2_get_subdev_hostdata(sd);
-       if (ov2722_info == NULL)
+       if (!ov2722_info)
                return -EINVAL;
 
        mutex_lock(&dev->input_lock);
@@ -1037,7 +1037,7 @@ static int ov2722_s_config(struct v4l2_subdev *sd,
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int ret = 0;
 
-       if (platform_data == NULL)
+       if (!platform_data)
                return -ENODEV;
 
        dev->platform_data =
@@ -1268,7 +1268,7 @@ static int __ov2722_init_ctrl_handler(struct ov2722_device *dev)
 
        dev->link_freq = v4l2_ctrl_find(&dev->ctrl_handler, V4L2_CID_LINK_FREQ);
 
-       if (dev->ctrl_handler.error || dev->link_freq == NULL)
+       if (dev->ctrl_handler.error || !dev->link_freq)
                return dev->ctrl_handler.error;
 
        dev->sd.ctrl_handler = hdl;