Skip to contentSkip to conversation

staging: media: atomisp: Coding style fixes

PATCH New Martiros Shakhzadyan 3 participants 8 messages Apr 12, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: media: atomisp: Coding style fixes

The following set of patches fixes coding style issues in atomisp-ov2722.

Martiros Shakhzadyan (3):
staging: media: atomisp: Removed a superfluous else clause
staging: media: atomisp: Removed a function entry log
staging: media: atomisp: Minor code style changes

 .../media/atomisp/i2c/atomisp-ov2722.c        | 20 +++++++++----------
 1 file changed, 9 insertions(+), 11 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 staging: media: atomisp: Removed a superfluous else clause

Fixed a coding style issue.

---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +5 -5
index eecefcd734d0..c017e9066b7a 100644
@@ -774,11 +774,11 @@ static int ov2722_s_power(struct v4l2_subdev *sd, int on)
 
 	if (on == 0)
 		return power_down(sd);
-	else {
-		ret = power_up(sd);
-		if (!ret)
-			return ov2722_init(sd);
-	}
+
+	ret = power_up(sd);
+	if (!ret)
+		return ov2722_init(sd);
+
 	return ret;
 }
 
Signature · 1 line
2.31.1
#2 lore raw

PATCH 1/1 staging: media: atomisp: Removed a function entry log

In reply to Martiros Shakhzadyan

Coding style fix.

---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -2
index c017e9066b7a..912eadaffc44 100644
@@ -1175,8 +1175,6 @@ static int ov2722_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2722_device *dev = to_ov2722_sensor(sd);
 
-	dev_dbg(&client->dev, "ov2722_remove...\n");
-
 	dev->platform_data->csi_cfg(sd, 0);
 	v4l2_ctrl_handler_free(&dev->ctrl_handler);
 	v4l2_device_unregister_subdev(sd);
Signature · 1 line
2.31.1
#3 lore raw

Re: [PATCH] staging: media: atomisp: Removed a function entry log

Quoted 1 line · Martiros Shakhzadyan

Coding style fix.

What exactly is the coding style issue? Please mention that.

Also, by removing the line you change the behavior (i.e. if debugging is enabled, you no longer see this message). That's more than a coding style fix...

Regards,

Hans

Quoted 20 lines
---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -2
index c017e9066b7a..912eadaffc44 100644
@@ -1175,8 +1175,6 @@ static int ov2722_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2722_device *dev = to_ov2722_sensor(sd);
 
-	dev_dbg(&client->dev, "ov2722_remove...\n");
-
 	dev->platform_data->csi_cfg(sd, 0);
 	v4l2_ctrl_handler_free(&dev->ctrl_handler);
 	v4l2_device_unregister_subdev(sd);
#4 lore raw

Re: Re: [PATCH] staging: media: atomisp: Removed a function entry log

Quoted 5 lines · Hans Verkuil
Quoted 1 line · Martiros Shakhzadyan

Coding style fix.

What exactly is the coding style issue? Please mention that.

Quoted 8 lines

Also, by removing the line you change the behavior (i.e. if debugging is enabled, you no longer see this message). That's more than a coding style fix...

Regards,

Hans

Thank you, Hans - I will resubmit the patch with a better commit message.

Quoted 21 lines
Quoted 20 lines
---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -2
index c017e9066b7a..912eadaffc44 100644
@@ -1175,8 +1175,6 @@ static int ov2722_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2722_device *dev = to_ov2722_sensor(sd);
 
-	dev_dbg(&client->dev, "ov2722_remove...\n");
-
 	dev->platform_data->csi_cfg(sd, 0);
 	v4l2_ctrl_handler_free(&dev->ctrl_handler);
 	v4l2_device_unregister_subdev(sd);
#5 lore raw

PATCH 1/1 staging: media: atomisp: Minor code style changes

In reply to Martiros Shakhzadyan

Fixed line continuation and parenthesis alignment issues.

squashme

---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +4 -4
index 912eadaffc44..90a985ee25fa 100644
@@ -49,8 +49,8 @@ static int ov2722_read_reg(struct i2c_client *client,
 		return -ENODEV;
 	}
 
-	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT
-	    && data_length != OV2722_32BIT) {
+	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT &&
+	    data_length != OV2722_32BIT) {
 		dev_err(&client->dev, "%s error, invalid data length\n",
 			__func__);
 		return -EINVAL;
@@ -212,8 +212,8 @@ static int __ov2722_buf_reg_array(struct i2c_client *client,
 }
 
 static int __ov2722_write_reg_is_consecutive(struct i2c_client *client,
-	struct ov2722_write_ctrl *ctrl,
-	const struct ov2722_reg *next)
+					     struct ov2722_write_ctrl *ctrl,
+					     const struct ov2722_reg *next)
 {
 	if (ctrl->index == 0)
 		return 1;
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#6 lore raw

Re: [PATCH] staging: media: atomisp: Minor code style changes

Hi Martiros,

Quoted 5 lines · Martiros Shakhzadyan

Fixed line continuation and parenthesis alignment issues.

squashme

This line should probably be dropped :)

Quoted 9 lines
---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -0
index 912eadaffc44..90a985ee25fa 100644

drivers/staging/media/atomisp/i2c/atomisp-ov2722.c static int ov2722_read_reg(struct i2c_client *client, · line 53

Quoted 7 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +2 -2
@@ -49,8 +49,8 @@ static int ov2722_read_reg(struct i2c_client *client,
 		return -ENODEV;
 	}
 
-	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT
-	    && data_length != OV2722_32BIT) {
+	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT &&
+	    data_length != OV2722_32BIT) {

Does checkpatch report this one ?

drivers/staging/media/atomisp/i2c/atomisp-ov2722.c static int __ov2722_buf_reg_array(struct i2c_client *client, · line 216

Quoted 11 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +2 -2
 		dev_err(&client->dev, "%s error, invalid data length\n",
 			__func__);
 		return -EINVAL;
@@ -212,8 +212,8 @@ static int __ov2722_buf_reg_array(struct i2c_client *client,
 }
 
 static int __ov2722_write_reg_is_consecutive(struct i2c_client *client,
-	struct ov2722_write_ctrl *ctrl,
-	const struct ov2722_reg *next)
+					     struct ov2722_write_ctrl *ctrl,
+					     const struct ov2722_reg *next)

These are probably 2 separate changes, but give this is just a style fix I think it's ok...

Quoted 6 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -1
 {
 	if (ctrl->index == 0)
 		return 1;
--

2.31.1

#7 lore raw

Re: Re: [PATCH] staging: media: atomisp: Minor code style changes

Quoted 11 lines · Jacopo Mondi

Hi Martiros,

Quoted 5 lines · Martiros Shakhzadyan

Fixed line continuation and parenthesis alignment issues.

squashme

This line should probably be dropped :)

Oops! :)

Quoted 12 lines
Quoted 12 lines
---
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -0
index 912eadaffc44..90a985ee25fa 100644
@@ -49,8 +49,8 @@ static int ov2722_read_reg(struct i2c_client *client,
 		return -ENODEV;
 	}
 
Quoted 7 lines

drivers/staging/media/atomisp/i2c/atomisp-ov2722.c static int ov2722_read_reg(struct i2c_client *client, · line 53

Quoted 4 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +2 -2
-	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT
-	    && data_length != OV2722_32BIT) {
+	if (data_length != OV2722_8BIT && data_length != OV2722_16BIT &&
+	    data_length != OV2722_32BIT) {

Does checkpatch report this one ?

It did. Once I moved && on the previous line it stopped complaining.

Quoted 15 lines

drivers/staging/media/atomisp/i2c/atomisp-ov2722.c static int __ov2722_buf_reg_array(struct i2c_client *client, · line 216

Quoted 11 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +2 -2
 		dev_err(&client->dev, "%s error, invalid data length\n",
 			__func__);
 		return -EINVAL;
@@ -212,8 +212,8 @@ static int __ov2722_buf_reg_array(struct i2c_client *client,
 }
 
 static int __ov2722_write_reg_is_consecutive(struct i2c_client *client,
-	struct ov2722_write_ctrl *ctrl,
-	const struct ov2722_reg *next)
+					     struct ov2722_write_ctrl *ctrl,
+					     const struct ov2722_reg *next)

These are probably 2 separate changes, but give this is just a style fix I think it's ok...

Quoted 4 lines

Thanks for the review - will resubmit with a fixed commit message.

Quoted 6 lines
Quoted 6 lines
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c +0 -1
 {
 	if (ctrl->index == 0)
 		return 1;
--

2.31.1