linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 3/9] staging: media: atomisp: remove unnecessary braces
       [not found] <cover.1619630709.git.drv@mailo.com>
@ 2021-04-28 18:06 ` Deepak R Varma
  2021-04-28 18:07 ` [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names Deepak R Varma
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

According to the coding style guidelines, if...else blocks with single
instructions do not need enclosing braces. This resolves checkpatch
WARNING / CHECK complaints.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - introduced.
Changes since v2:
   - None.
Changes since v1:
   - None.


 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index c90730513438..f167781e258a 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -461,11 +461,11 @@ static int ov2680_v_flip(struct v4l2_subdev *sd, s32 value)
 	ret = ov2680_read_reg(client, 1, OV2680_FLIP_REG, &val);
 	if (ret)
 		return ret;
-	if (value) {
+	if (value)
 		val |= OV2680_FLIP_MIRROR_BIT_ENABLE;
-	} else {
+	else
 		val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE;
-	}
+
 	ret = ov2680_write_reg(client, 1,
 			       OV2680_FLIP_REG, val);
 	if (ret)
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names
       [not found] <cover.1619630709.git.drv@mailo.com>
  2021-04-28 18:06 ` [PATCH v4 3/9] staging: media: atomisp: remove unnecessary braces Deepak R Varma
@ 2021-04-28 18:07 ` Deepak R Varma
  2021-05-17 13:44   ` Mauro Carvalho Chehab
  2021-04-28 18:08 ` [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks Deepak R Varma
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

Replace hard coded function names from the debug print strings by
standard __func__ predefined identifier. This resolves following
checkpatch script WARNING:
Prefer using '"%s...", __func__' to using function's name, in a string.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - None.
Changes since v2:
   - None.
Changes since v1:
   - None.

 .../staging/media/atomisp/i2c/atomisp-gc0310.c   |  2 +-
 .../staging/media/atomisp/i2c/atomisp-gc2235.c   |  2 +-
 .../staging/media/atomisp/i2c/atomisp-lm3554.c   |  2 +-
 .../staging/media/atomisp/i2c/atomisp-ov2680.c   | 16 ++++++++--------
 .../staging/media/atomisp/i2c/atomisp-ov2722.c   |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index d68a2bcc9ae1..b572551f1a0d 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -1292,7 +1292,7 @@ static int gc0310_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct gc0310_device *dev = to_gc0310_sensor(sd);
 
-	dev_dbg(&client->dev, "gc0310_remove...\n");
+	dev_dbg(&client->dev, "%s...\n", __func__);
 
 	dev->platform_data->csi_cfg(sd, 0);
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index e722c639b60d..548c572d3b57 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -1034,7 +1034,7 @@ static int gc2235_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct gc2235_device *dev = to_gc2235_sensor(sd);
 
-	dev_dbg(&client->dev, "gc2235_remove...\n");
+	dev_dbg(&client->dev, "%s...\n", __func__);
 
 	dev->platform_data->csi_cfg(sd, 0);
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
index 7ca7378b1859..ab10fd98dbc0 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
@@ -680,7 +680,7 @@ static int lm3554_detect(struct v4l2_subdev *sd)
 	int ret;
 
 	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
-		dev_err(&client->dev, "lm3554_detect i2c error\n");
+		dev_err(&client->dev, "%s i2c error\n", __func__);
 		return -ENODEV;
 	}
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index f167781e258a..a51ad9843d39 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -146,7 +146,7 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_x\n");
+	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	*val = ov2680_res[dev->fmt_idx].bin_factor_x;
 
 	return 0;
@@ -158,7 +158,7 @@ static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val)
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 
 	*val = ov2680_res[dev->fmt_idx].bin_factor_y;
-	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_y\n");
+	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	return 0;
 }
 
@@ -173,7 +173,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
 	u16 reg_val;
 	int ret;
 
-	dev_dbg(&client->dev,  "++++ov2680_get_intg_factor\n");
+	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	if (!info)
 		return -EINVAL;
 
@@ -251,8 +251,8 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
 	int ret, exp_val;
 
 	dev_dbg(&client->dev,
-		"+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",
-		coarse_itg, gain, digitgain);
+		"+++++++%s coarse_itg %d, gain %d, digitgain %d++\n",
+		__func__, coarse_itg, gain, digitgain);
 
 	vts = ov2680_res[dev->fmt_idx].lines_per_frame;
 
@@ -1060,9 +1060,9 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable)
 
 	mutex_lock(&dev->input_lock);
 	if (enable)
-		dev_dbg(&client->dev, "ov2680_s_stream one\n");
+		dev_dbg(&client->dev, "%s one\n", __func__);
 	else
-		dev_dbg(&client->dev, "ov2680_s_stream off\n");
+		dev_dbg(&client->dev, "%s off\n", __func__);
 
 	ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM,
 			       enable ? OV2680_START_STREAMING :
@@ -1226,7 +1226,7 @@ static int ov2680_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
 
-	dev_dbg(&client->dev, "ov2680_remove...\n");
+	dev_dbg(&client->dev, "%s...\n", __func__);
 
 	dev->platform_data->csi_cfg(sd, 0);
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
index d046a9804f63..69409f8447b5 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
@@ -1175,7 +1175,7 @@ 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_dbg(&client->dev, "%s...\n", __func__);
 
 	dev->platform_data->csi_cfg(sd, 0);
 	v4l2_ctrl_handler_free(&dev->ctrl_handler);
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
       [not found] <cover.1619630709.git.drv@mailo.com>
  2021-04-28 18:06 ` [PATCH v4 3/9] staging: media: atomisp: remove unnecessary braces Deepak R Varma
  2021-04-28 18:07 ` [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names Deepak R Varma
@ 2021-04-28 18:08 ` Deepak R Varma
  2021-04-29  7:06   ` Fabio Aiuto
  2021-04-28 18:09 ` [PATCH v4 6/9] staging: media: atomisp: fix CamelCase variable naming Deepak R Varma
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

Reformat code comment blocks according to the coding style guidelines.
This resolves different checkpatch script WARNINGs around block comments.

Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - Include additional header files in the clean up
Changes since v2:
   - Tag Fabio Auito for the patch suggestion

Changes in v1:
   - implement following changes suggested by Fabio Aiuto
       a. Corrected commenting style
       b. Similar style implemented for other comment blocks in
          the same files.

 .../media/atomisp/i2c/atomisp-gc2235.c        | 19 ++++---
 .../atomisp/i2c/atomisp-libmsrlisthelper.c    |  6 ++-
 .../media/atomisp/i2c/atomisp-mt9m114.c       | 49 ++++++++++++-------
 .../media/atomisp/i2c/atomisp-ov2680.c        | 20 +++++---
 drivers/staging/media/atomisp/i2c/mt9m114.h   |  3 +-
 drivers/staging/media/atomisp/i2c/ov2680.h    | 10 ++--
 6 files changed, 65 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index 548c572d3b57..6ee6e8414f0e 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -228,7 +228,7 @@ static int gc2235_g_focal(struct v4l2_subdev *sd, s32 *val)
 
 static int gc2235_g_fnumber(struct v4l2_subdev *sd, s32 *val)
 {
-	/*const f number for imx*/
+	/* const f number for imx */
 	*val = (GC2235_F_NUMBER_DEFAULT_NUM << 16) | GC2235_F_NUMBER_DEM;
 	return 0;
 }
@@ -427,7 +427,8 @@ static long gc2235_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 	return 0;
 }
 
-/* This returns the exposure time being used. This should only be used
+/*
+ * This returns the exposure time being used. This should only be used
  * for filling in EXIF data, not for actual image processing.
  */
 static int gc2235_q_exposure(struct v4l2_subdev *sd, s32 *value)
@@ -746,11 +747,12 @@ static int startup(struct v4l2_subdev *sd)
 	int ret = 0;
 
 	if (is_init == 0) {
-		/* force gc2235 to do a reset in res change, otherwise it
-		* can not output normal after switching res. and it is not
-		* necessary for first time run up after power on, for the sack
-		* of performance
-		*/
+		/*
+		 * force gc2235 to do a reset in res change, otherwise it
+		 * can not output normal after switching res. and it is not
+		 * necessary for first time run up after power on, for the sack
+		 * of performance
+		 */
 		power_down(sd);
 		power_up(sd);
 		gc2235_write_reg_array(client, gc2235_init_settings);
@@ -904,7 +906,8 @@ static int gc2235_s_config(struct v4l2_subdev *sd,
 	    (struct camera_sensor_platform_data *)platform_data;
 
 	mutex_lock(&dev->input_lock);
-	/* power off the module, then power on it in future
+	/*
+	 * power off the module, then power on it in future
 	 * as first power on by board may not fulfill the
 	 * power on sequqence needed by the module
 	 */
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c b/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
index b93c80471f22..7a20d918a9d5 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
@@ -50,14 +50,16 @@ struct tbd_data_record_header {
 static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr,
 				 unsigned int size)
 {
-	/* The configuration data contains any number of sequences where
+	/*
+	 * The configuration data contains any number of sequences where
 	 * the first byte (that is, uint8_t) that marks the number of bytes
 	 * in the sequence to follow, is indeed followed by the indicated
 	 * number of bytes of actual data to be written to sensor.
 	 * By convention, the first two bytes of actual data should be
 	 * understood as an address in the sensor address space (hibyte
 	 * followed by lobyte) where the remaining data in the sequence
-	 * will be written. */
+	 * will be written.
+	 */
 
 	u8 *ptr = bufptr;
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
index 465fc4468442..a5f0b4848ddf 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
@@ -475,10 +475,12 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
 	if (!dev || !dev->platform_data)
 		return -ENODEV;
 
-	/* Note: current modules wire only one GPIO signal (RESET#),
+	/*
+	 * Note: current modules wire only one GPIO signal (RESET#),
 	 * but the schematic wires up two to the connector.  BIOS
 	 * versions have been unfortunately inconsistent with which
-	 * ACPI index RESET# is on, so hit both */
+	 * ACPI index RESET# is on, so hit both
+	 */
 
 	if (flag) {
 		ret = dev->platform_data->gpio0_ctrl(sd, 0);
@@ -560,7 +562,7 @@ static int power_down(struct v4l2_subdev *sd)
 	if (ret)
 		dev_err(&client->dev, "vprog failed.\n");
 
-	/*according to DS, 20ms is needed after power down*/
+	/* according to DS, 20ms is needed after power down */
 	msleep(20);
 
 	return ret;
@@ -947,7 +949,7 @@ static int mt9m114_g_focal(struct v4l2_subdev *sd, s32 *val)
 
 static int mt9m114_g_fnumber(struct v4l2_subdev *sd, s32 *val)
 {
-	/*const f number for mt9m114*/
+	/* const f number for mt9m114 */
 	*val = (MT9M114_F_NUMBER_DEFAULT_NUM << 16) | MT9M114_F_NUMBER_DEM;
 	return 0;
 }
@@ -1008,8 +1010,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 		exposure->gain[1]);
 
 	coarse_integration = exposure->integration_time[0];
-	/* fine_integration = ExposureTime.FineIntegrationTime; */
-	/* FrameLengthLines = ExposureTime.FrameLengthLines; */
+	/*
+	 * fine_integration = ExposureTime.FineIntegrationTime;
+	 * FrameLengthLines = ExposureTime.FrameLengthLines;
+	 */
 	FLines = mt9m114_res[dev->res].lines_per_frame;
 	AnalogGain = exposure->gain[0];
 	DigitalGain = exposure->gain[1];
@@ -1019,8 +1023,8 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 		dev->first_gain = AnalogGain;
 		dev->first_diggain = DigitalGain;
 	}
-	/* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) +
-	((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8); */
+	/* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) +		*/
+	/* ((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8);	*/
 
 	/* set frame length */
 	if (FLines < coarse_integration + 6)
@@ -1034,8 +1038,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 	}
 
 	/* set coarse integration */
-	/* 3A provide real exposure time.
-		should not translate to any value here. */
+	/*
+	 * 3A provide real exposure time.
+	 * should not translate to any value here.
+	 */
 	ret = mt9m114_write_reg(client, MISENSOR_16BIT,
 				REG_EXPO_COARSE, (u16)(coarse_integration));
 	if (ret) {
@@ -1044,7 +1050,7 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 	}
 
 	/*
-	// set analog/digital gain
+	 * set analog/digital gain
 	switch(AnalogGain)
 	{
 	case 0:
@@ -1069,8 +1075,9 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 	*/
 	if (DigitalGain >= 16 || DigitalGain <= 1)
 		DigitalGain = 1;
-	/* AnalogGainToWrite =
-		(u16)((DigitalGain << 12) | AnalogGainToWrite); */
+	/*
+	 * AnalogGainToWrite = (u16)((DigitalGain << 12) | AnalogGainToWrite);
+	 */
 	AnalogGainToWrite = (u16)((DigitalGain << 12) | (u16)AnalogGain);
 	ret = mt9m114_write_reg(client, MISENSOR_16BIT,
 				REG_GAIN, AnalogGainToWrite);
@@ -1095,8 +1102,10 @@ static long mt9m114_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 	return 0;
 }
 
-/* This returns the exposure time being used. This should only be used
-   for filling in EXIF data, not for actual image processing. */
+/*
+ * This returns the exposure time being used. This should only be used
+ * for filling in EXIF data, not for actual image processing.
+ */
 static int mt9m114_g_exposure(struct v4l2_subdev *sd, s32 *value)
 {
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -1247,7 +1256,8 @@ static int mt9m114_s_ev(struct v4l2_subdev *sd, s32 val)
 	s32 luma = 0x37;
 	int err;
 
-	/* EV value only support -2 to 2
+	/*
+	 * EV value only support -2 to 2
 	 * 0: 0x37, 1:0x47, 2:0x57, -1:0x27, -2:0x17
 	 */
 	if (val < -2 || val > 2)
@@ -1295,9 +1305,10 @@ static int mt9m114_g_ev(struct v4l2_subdev *sd, s32 *val)
 	return 0;
 }
 
-/* Fake interface
+/*
+ * Fake interface
  * mt9m114 now can not support 3a_lock
-*/
+ */
 static int mt9m114_s_3a_lock(struct v4l2_subdev *sd, s32 val)
 {
 	aaalock = val;
@@ -1843,7 +1854,7 @@ static int mt9m114_probe(struct i2c_client *client)
 		return ret;
 	}
 
-	/*TODO add format code here*/
+	/* TODO add format code here */
 	dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
 	dev->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index a51ad9843d39..d5fa3ea624ef 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -127,7 +127,7 @@ static int ov2680_g_focal(struct v4l2_subdev *sd, s32 *val)
 
 static int ov2680_g_fnumber(struct v4l2_subdev *sd, s32 *val)
 {
-	/*const f number for ov2680*/
+	/* const f number for ov2680 */
 
 	*val = (OV2680_F_NUMBER_DEFAULT_NUM << 16) | OV2680_F_NUMBER_DEM;
 	return 0;
@@ -399,7 +399,8 @@ static long ov2680_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 	return 0;
 }
 
-/* This returns the exposure time being used. This should only be used
+/*
+ * This returns the exposure time being used. This should only be used
  * for filling in EXIF data, not for actual image processing.
  */
 static int ov2680_q_exposure(struct v4l2_subdev *sd, s32 *value)
@@ -727,11 +728,13 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
 	if (!dev || !dev->platform_data)
 		return -ENODEV;
 
-	/* The OV2680 documents only one GPIO input (#XSHUTDN), but
+	/*
+	 * The OV2680 documents only one GPIO input (#XSHUTDN), but
 	 * existing integrations often wire two (reset/power_down)
 	 * because that is the way other sensors work.  There is no
 	 * way to tell how it is wired internally, so existing
-	 * firmwares expose both and we drive them symmetrically. */
+	 * firmwares expose both and we drive them symmetrically.
+	 */
 	if (flag) {
 		ret = dev->platform_data->gpio0_ctrl(sd, 1);
 		usleep_range(10000, 15000);
@@ -977,7 +980,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 		goto err;
 	}
 
-	/*recall flip functions to avoid flip registers
+	/*
+	 * recall flip functions to avoid flip registers
 	 * were overridden by default setting
 	 */
 	if (h_flag)
@@ -987,7 +991,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 
 	v4l2_info(client, "\n%s idx %d\n", __func__, dev->fmt_idx);
 
-	/*ret = startup(sd);
+	/*
+	 * ret = startup(sd);
 	 * if (ret)
 	 * dev_err(&client->dev, "ov2680 startup err\n");
 	 */
@@ -1096,7 +1101,8 @@ static int ov2680_s_config(struct v4l2_subdev *sd,
 	    (struct camera_sensor_platform_data *)platform_data;
 
 	mutex_lock(&dev->input_lock);
-	/* power off the module, then power on it in future
+	/*
+	 * power off the module, then power on it in future
 	 * as first power on by board may not fulfill the
 	 * power on sequqence needed by the module
 	 */
diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
index 787bbf59e895..aad98f37aaa6 100644
--- a/drivers/staging/media/atomisp/i2c/mt9m114.h
+++ b/drivers/staging/media/atomisp/i2c/mt9m114.h
@@ -765,7 +765,8 @@ static struct misensor_reg const mt9m114_common[] = {
 	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
 	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
 	/* LOAD = Step3-Recommended
-	 * Patch,Errata and Sensor optimization Setting */
+	 * Patch,Errata and Sensor optimization Setting
+	 */
 	{MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
 	{MISENSOR_16BIT, 0x316C, 0x8270}, /* DAC_TXLO */
 	{MISENSOR_16BIT, 0x3ED0, 0x2305}, /* DAC_LD_4_5 */
diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h b/drivers/staging/media/atomisp/i2c/ov2680.h
index 49920245e064..4d43b45915e5 100644
--- a/drivers/staging/media/atomisp/i2c/ov2680.h
+++ b/drivers/staging/media/atomisp/i2c/ov2680.h
@@ -459,8 +459,8 @@ static struct ov2680_reg const ov2680_656x496_30fps[] = {
 };
 
 /*
-* 800x600 30fps  VBlanking 1lane 10Bit (binning)
-*/
+ * 800x600 30fps  VBlanking 1lane 10Bit (binning)
+ */
 static struct ov2680_reg const ov2680_720x592_30fps[] = {
 	{0x3086, 0x01},
 	{0x3501, 0x26},
@@ -504,8 +504,8 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {
 };
 
 /*
-* 800x600 30fps  VBlanking 1lane 10Bit (binning)
-*/
+ * 800x600 30fps  VBlanking 1lane 10Bit (binning)
+ */
 static struct ov2680_reg const ov2680_800x600_30fps[] = {
 	{0x3086, 0x01},
 	{0x3501, 0x26},
@@ -634,7 +634,7 @@ static struct ov2680_reg const ov2680_1296x976_30fps[] = {
 
 /*
  *   1456*1096 30fps  VBlanking 1lane 10bit(no-scaling)
-*/
+ */
 static struct ov2680_reg const ov2680_1456x1096_30fps[] = {
 	{0x3086, 0x00},
 	{0x3501, 0x48},
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 6/9] staging: media: atomisp: fix CamelCase variable naming
       [not found] <cover.1619630709.git.drv@mailo.com>
                   ` (2 preceding siblings ...)
  2021-04-28 18:08 ` [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks Deepak R Varma
@ 2021-04-28 18:09 ` Deepak R Varma
  2021-04-28 18:09 ` [PATCH v4 7/9] staging: media: atomisp: replace raw pr_*() by dev_dbg() Deepak R Varma
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:09 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

Mixed case variable names are discouraged and they result in checkpatch
script "Avoid CamelCase" warnings. Replace such CamelCase variable names
by lower case strings according to the coding style guidelines.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - None.
Changes since v2:
   - None.
Changes since v1:
   - None.


 .../media/atomisp/i2c/atomisp-mt9m114.c       | 63 ++++++++++---------
 1 file changed, 32 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
index a5f0b4848ddf..0a6f8f68b215 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
@@ -1000,10 +1000,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 	struct mt9m114_device *dev = to_mt9m114_sensor(sd);
 	int ret = 0;
 	unsigned int coarse_integration = 0;
-	unsigned int FLines = 0;
-	unsigned int FrameLengthLines = 0; /* ExposureTime.FrameLengthLines; */
-	unsigned int AnalogGain, DigitalGain;
-	u32 AnalogGainToWrite = 0;
+	unsigned int f_lines = 0;
+	unsigned int frame_len_lines = 0; /* ExposureTime.FrameLengthLines; */
+	unsigned int analog_gain, digital_gain;
+	u32 analog_gain_to_write = 0;
 
 	dev_dbg(&client->dev, "%s(0x%X 0x%X 0x%X)\n", __func__,
 		exposure->integration_time[0], exposure->gain[0],
@@ -1012,28 +1012,28 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 	coarse_integration = exposure->integration_time[0];
 	/*
 	 * fine_integration = ExposureTime.FineIntegrationTime;
-	 * FrameLengthLines = ExposureTime.FrameLengthLines;
+	 * frame_len_lines = ExposureTime.FrameLengthLines;
 	 */
-	FLines = mt9m114_res[dev->res].lines_per_frame;
-	AnalogGain = exposure->gain[0];
-	DigitalGain = exposure->gain[1];
+	f_lines = mt9m114_res[dev->res].lines_per_frame;
+	analog_gain = exposure->gain[0];
+	digital_gain = exposure->gain[1];
 	if (!dev->streamon) {
 		/*Save the first exposure values while stream is off*/
 		dev->first_exp = coarse_integration;
-		dev->first_gain = AnalogGain;
-		dev->first_diggain = DigitalGain;
+		dev->first_gain = analog_gain;
+		dev->first_diggain = digital_gain;
 	}
-	/* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) +		*/
-	/* ((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8);	*/
+	/* digital_gain = 0x400 * (((u16) digital_gain) >> 8) +		*/
+	/* ((unsigned int)(0x400 * (((u16) digital_gain) & 0xFF)) >>8); */
 
 	/* set frame length */
-	if (FLines < coarse_integration + 6)
-		FLines = coarse_integration + 6;
-	if (FLines < FrameLengthLines)
-		FLines = FrameLengthLines;
-	ret = mt9m114_write_reg(client, MISENSOR_16BIT, 0x300A, FLines);
+	if (f_lines < coarse_integration + 6)
+		f_lines = coarse_integration + 6;
+	if (f_lines < frame_len_lines)
+		f_lines = frame_len_lines;
+	ret = mt9m114_write_reg(client, MISENSOR_16BIT, 0x300A, f_lines);
 	if (ret) {
-		v4l2_err(client, "%s: fail to set FLines\n", __func__);
+		v4l2_err(client, "%s: fail to set f_lines\n", __func__);
 		return -EINVAL;
 	}
 
@@ -1051,38 +1051,39 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
 
 	/*
 	 * set analog/digital gain
-	switch(AnalogGain)
+	switch(analog_gain)
 	{
 	case 0:
-	  AnalogGainToWrite = 0x0;
+	  analog_gain_to_write = 0x0;
 	  break;
 	case 1:
-	  AnalogGainToWrite = 0x20;
+	  analog_gain_to_write = 0x20;
 	  break;
 	case 2:
-	  AnalogGainToWrite = 0x60;
+	  analog_gain_to_write = 0x60;
 	  break;
 	case 4:
-	  AnalogGainToWrite = 0xA0;
+	  analog_gain_to_write = 0xA0;
 	  break;
 	case 8:
-	  AnalogGainToWrite = 0xE0;
+	  analog_gain_to_write = 0xE0;
 	  break;
 	default:
-	  AnalogGainToWrite = 0x20;
+	  analog_gain_to_write = 0x20;
 	  break;
 	}
 	*/
-	if (DigitalGain >= 16 || DigitalGain <= 1)
-		DigitalGain = 1;
+	if (digital_gain >= 16 || digital_gain <= 1)
+		digital_gain = 1;
 	/*
-	 * AnalogGainToWrite = (u16)((DigitalGain << 12) | AnalogGainToWrite);
+	 * analog_gain_to_write = (u16)((digital_gain << 12)
+	 *				| analog_gain_to_write);
 	 */
-	AnalogGainToWrite = (u16)((DigitalGain << 12) | (u16)AnalogGain);
+	analog_gain_to_write = (u16)((digital_gain << 12) | (u16)analog_gain);
 	ret = mt9m114_write_reg(client, MISENSOR_16BIT,
-				REG_GAIN, AnalogGainToWrite);
+				REG_GAIN, analog_gain_to_write);
 	if (ret) {
-		v4l2_err(client, "%s: fail to set AnalogGainToWrite\n",
+		v4l2_err(client, "%s: fail to set analog_gain_to_write\n",
 			 __func__);
 		return -EINVAL;
 	}
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 7/9] staging: media: atomisp: replace raw pr_*() by dev_dbg()
       [not found] <cover.1619630709.git.drv@mailo.com>
                   ` (3 preceding siblings ...)
  2021-04-28 18:09 ` [PATCH v4 6/9] staging: media: atomisp: fix CamelCase variable naming Deepak R Varma
@ 2021-04-28 18:09 ` Deepak R Varma
  2021-04-28 18:10 ` [PATCH v4 8/9] staging: media: atomisp: remove unnecessary pr_info calls Deepak R Varma
  2021-04-28 18:10 ` [PATCH v4 9/9] staging: media: atomisp: remove unwanted dev_*() calls Deepak R Varma
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:09 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

It is recommended to use driver model diagnostic macros dev_*() instead
of raw printk() or pr_*() since the former ensures that the log messages
are always associated with the corresponding device and driver. This also
addresses the checkpatch complain for not using KERN_<LEVEL> facility in
printk() call.

Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - use dev_dbg instead of dev_info since it spams less
Changes since v2:
   - Tag Fabio Auito for the patch suggestion
Changes in v1:
   - implement following changes suggested by Fabio Aiuto
       a. use dev_info instead of pr_info
       b. update patch log message accordingly


 .../media/atomisp/i2c/atomisp-gc0310.c        | 30 +++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index b572551f1a0d..bb75d077ad63 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -300,7 +300,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 	/* pixel clock calculattion */
 	dev->vt_pix_clk_freq_mhz = 14400000; // 16.8MHz
 	buf->vt_pix_clk_freq_mhz = dev->vt_pix_clk_freq_mhz;
-	pr_info("vt_pix_clk_freq_mhz=%d\n", buf->vt_pix_clk_freq_mhz);
+	dev_dbg(&client->dev, "vt_pix_clk_freq_mhz=%d\n", buf->vt_pix_clk_freq_mhz);
 
 	/* get integration time */
 	buf->coarse_integration_time_min = GC0310_COARSE_INTG_TIME_MIN;
@@ -326,7 +326,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 	if (ret)
 		return ret;
 	buf->crop_horizontal_start = val | (reg_val & 0xFF);
-	pr_info("crop_horizontal_start=%d\n", buf->crop_horizontal_start);
+	dev_dbg(&client->dev, "crop_horizontal_start=%d\n", buf->crop_horizontal_start);
 
 	/* Getting crop_vertical_start */
 	ret =  gc0310_read_reg(client, GC0310_8BIT,
@@ -339,7 +339,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 	if (ret)
 		return ret;
 	buf->crop_vertical_start = val | (reg_val & 0xFF);
-	pr_info("crop_vertical_start=%d\n", buf->crop_vertical_start);
+	dev_dbg(&client->dev, "crop_vertical_start=%d\n", buf->crop_vertical_start);
 
 	/* Getting output_width */
 	ret = gc0310_read_reg(client, GC0310_8BIT,
@@ -352,7 +352,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 	if (ret)
 		return ret;
 	buf->output_width = val | (reg_val & 0xFF);
-	pr_info("output_width=%d\n", buf->output_width);
+	dev_dbg(&client->dev, "output_width=%d\n", buf->output_width);
 
 	/* Getting output_height */
 	ret = gc0310_read_reg(client, GC0310_8BIT,
@@ -365,12 +365,12 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 	if (ret)
 		return ret;
 	buf->output_height = val | (reg_val & 0xFF);
-	pr_info("output_height=%d\n", buf->output_height);
+	dev_dbg(&client->dev, "output_height=%d\n", buf->output_height);
 
 	buf->crop_horizontal_end = buf->crop_horizontal_start + buf->output_width - 1;
 	buf->crop_vertical_end = buf->crop_vertical_start + buf->output_height - 1;
-	pr_info("crop_horizontal_end=%d\n", buf->crop_horizontal_end);
-	pr_info("crop_vertical_end=%d\n", buf->crop_vertical_end);
+	dev_dbg(&client->dev, "crop_horizontal_end=%d\n", buf->crop_horizontal_end);
+	dev_dbg(&client->dev, "crop_vertical_end=%d\n", buf->crop_vertical_end);
 
 	/* Getting line_length_pck */
 	ret = gc0310_read_reg(client, GC0310_8BIT,
@@ -389,7 +389,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 		return ret;
 	sh_delay = reg_val;
 	buf->line_length_pck = buf->output_width + hori_blanking + sh_delay + 4;
-	pr_info("hori_blanking=%d sh_delay=%d line_length_pck=%d\n", hori_blanking,
+	dev_dbg(&client->dev, "hori_blanking=%d sh_delay=%d line_length_pck=%d\n", hori_blanking,
 		sh_delay, buf->line_length_pck);
 
 	/* Getting frame_length_lines */
@@ -404,7 +404,7 @@ static int gc0310_get_intg_factor(struct i2c_client *client,
 		return ret;
 	vert_blanking = val | (reg_val & 0xFF);
 	buf->frame_length_lines = buf->output_height + vert_blanking;
-	pr_info("vert_blanking=%d frame_length_lines=%d\n", vert_blanking,
+	dev_dbg(&client->dev, "vert_blanking=%d frame_length_lines=%d\n", vert_blanking,
 		buf->frame_length_lines);
 
 	buf->binning_factor_x = res->bin_factor_x ?
@@ -434,7 +434,7 @@ static int gc0310_set_gain(struct v4l2_subdev *sd, int gain)
 		dgain = gain / 2;
 	}
 
-	pr_info("gain=0x%x again=0x%x dgain=0x%x\n", gain, again, dgain);
+	dev_dbg(&client->dev, "gain=0x%x again=0x%x dgain=0x%x\n", gain, again, dgain);
 
 	/* set analog gain */
 	ret = gc0310_write_reg(client, GC0310_8BIT,
@@ -458,7 +458,7 @@ static int __gc0310_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	int ret;
 
-	pr_info("coarse_itg=%d gain=%d digitgain=%d\n", coarse_itg, gain, digitgain);
+	dev_dbg(&client->dev, "coarse_itg=%d gain=%d digitgain=%d\n", coarse_itg, gain, digitgain);
 
 	/* set exposure */
 	ret = gc0310_write_reg(client, GC0310_8BIT,
@@ -1020,8 +1020,8 @@ static int gc0310_set_fmt(struct v4l2_subdev *sd,
 		return -EINVAL;
 	}
 
-	printk("%s: before gc0310_write_reg_array %s\n", __func__,
-	       gc0310_res[dev->fmt_idx].desc);
+	dev_dbg(&client->dev, "%s: before gc0310_write_reg_array %s\n",
+		__func__, gc0310_res[dev->fmt_idx].desc);
 	ret = startup(sd);
 	if (ret) {
 		dev_err(&client->dev, "gc0310 startup err\n");
@@ -1085,7 +1085,7 @@ static int gc0310_detect(struct i2c_client *client)
 		return -ENODEV;
 	}
 	id = ((((u16)high) << 8) | (u16)low);
-	pr_info("sensor ID = 0x%x\n", id);
+	dev_dbg(&client->dev, "sensor ID = 0x%x\n", id);
 
 	if (id != GC0310_ID) {
 		dev_err(&client->dev, "sensor ID error, read id = 0x%x, target id = 0x%x\n", id,
@@ -1106,7 +1106,7 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	int ret;
 
-	pr_info("%s S enable=%d\n", __func__, enable);
+	dev_dbg(&client->dev, "%s S enable=%d\n", __func__, enable);
 	mutex_lock(&dev->input_lock);
 
 	if (enable) {
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 8/9] staging: media: atomisp: remove unnecessary pr_info calls
       [not found] <cover.1619630709.git.drv@mailo.com>
                   ` (4 preceding siblings ...)
  2021-04-28 18:09 ` [PATCH v4 7/9] staging: media: atomisp: replace raw pr_*() by dev_dbg() Deepak R Varma
@ 2021-04-28 18:10 ` Deepak R Varma
  2021-04-28 18:10 ` [PATCH v4 9/9] staging: media: atomisp: remove unwanted dev_*() calls Deepak R Varma
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

pr_info() messages to log function entry / exit tracing spams the log.
Such basic tracing is not necessary and be removed.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - Patch introduced based on other patch review feedback
Changes since v2:
   - Patch not part of set
Changes since v1:
   - Patch not part of set



 .../staging/media/atomisp/i2c/atomisp-gc0310.c  | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index bb75d077ad63..5f1929a49b07 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -718,7 +718,6 @@ static int gc0310_init(struct v4l2_subdev *sd)
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	struct gc0310_device *dev = to_gc0310_sensor(sd);
 
-	pr_info("%s S\n", __func__);
 	mutex_lock(&dev->input_lock);
 
 	/* set initial registers */
@@ -730,7 +729,6 @@ static int gc0310_init(struct v4l2_subdev *sd)
 
 	mutex_unlock(&dev->input_lock);
 
-	pr_info("%s E\n", __func__);
 	return ret;
 }
 
@@ -796,7 +794,6 @@ static int power_up(struct v4l2_subdev *sd)
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	int ret;
 
-	pr_info("%s S\n", __func__);
 	if (!dev->platform_data) {
 		dev_err(&client->dev,
 			"no camera_sensor_platform_data");
@@ -823,7 +820,6 @@ static int power_up(struct v4l2_subdev *sd)
 
 	msleep(100);
 
-	pr_info("%s E\n", __func__);
 	return 0;
 
 fail_gpio:
@@ -959,15 +955,12 @@ static int startup(struct v4l2_subdev *sd)
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	int ret = 0;
 
-	pr_info("%s S\n", __func__);
-
 	ret = gc0310_write_reg_array(client, gc0310_res[dev->fmt_idx].regs);
 	if (ret) {
 		dev_err(&client->dev, "gc0310 write register err.\n");
 		return ret;
 	}
 
-	pr_info("%s E\n", __func__);
 	return ret;
 }
 
@@ -982,8 +975,6 @@ static int gc0310_set_fmt(struct v4l2_subdev *sd,
 	int ret = 0;
 	int idx = 0;
 
-	pr_info("%s S\n", __func__);
-
 	if (format->pad)
 		return -EINVAL;
 
@@ -1035,7 +1026,6 @@ static int gc0310_set_fmt(struct v4l2_subdev *sd,
 		goto err;
 	}
 
-	pr_info("%s E\n", __func__);
 err:
 	mutex_unlock(&dev->input_lock);
 	return ret;
@@ -1068,7 +1058,6 @@ static int gc0310_detect(struct i2c_client *client)
 	int ret;
 	u16 id;
 
-	pr_info("%s S\n", __func__);
 	if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
 		return -ENODEV;
 
@@ -1095,8 +1084,6 @@ static int gc0310_detect(struct i2c_client *client)
 
 	dev_dbg(&client->dev, "detect gc0310 success\n");
 
-	pr_info("%s E\n", __func__);
-
 	return 0;
 }
 
@@ -1142,7 +1129,6 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
 	}
 
 	mutex_unlock(&dev->input_lock);
-	pr_info("%s E\n", __func__);
 	return ret;
 }
 
@@ -1153,7 +1139,6 @@ static int gc0310_s_config(struct v4l2_subdev *sd,
 	struct i2c_client *client = v4l2_get_subdevdata(sd);
 	int ret = 0;
 
-	pr_info("%s S\n", __func__);
 	if (!platform_data)
 		return -ENODEV;
 
@@ -1196,7 +1181,6 @@ static int gc0310_s_config(struct v4l2_subdev *sd,
 	}
 	mutex_unlock(&dev->input_lock);
 
-	pr_info("%s E\n", __func__);
 	return 0;
 
 fail_csi_cfg:
@@ -1365,7 +1349,6 @@ static int gc0310_probe(struct i2c_client *client)
 	if (ret)
 		gc0310_remove(client);
 
-	pr_info("%s E\n", __func__);
 	return ret;
 out_free:
 	v4l2_device_unregister_subdev(&dev->sd);
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH v4 9/9] staging: media: atomisp: remove unwanted dev_*() calls
       [not found] <cover.1619630709.git.drv@mailo.com>
                   ` (5 preceding siblings ...)
  2021-04-28 18:10 ` [PATCH v4 8/9] staging: media: atomisp: remove unnecessary pr_info calls Deepak R Varma
@ 2021-04-28 18:10 ` Deepak R Varma
  6 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-04-28 18:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, drv

Delete diagnostic messages that only print the function name. We can use
ftrace for such debugging. The clean up also enables removing (now) unused
device pointers.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
---

Changes since v3:
   - Patch introduced based on other patch review feedback
Changes since v2:
   - Patch not part of set
Changes since v1:
   - Patch not part of set


 drivers/staging/media/atomisp/i2c/atomisp-gc0310.c | 2 --
 drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 --
 drivers/staging/media/atomisp/i2c/atomisp-ov2680.c | 7 -------
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 2 --
 4 files changed, 13 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
index 5f1929a49b07..d5acd261c977 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
@@ -1276,8 +1276,6 @@ static int gc0310_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct gc0310_device *dev = to_gc0310_sensor(sd);
 
-	dev_dbg(&client->dev, "%s...\n", __func__);
-
 	dev->platform_data->csi_cfg(sd, 0);
 
 	v4l2_device_unregister_subdev(sd);
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index 6ee6e8414f0e..0b95b738af0e 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -1037,8 +1037,6 @@ static int gc2235_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct gc2235_device *dev = to_gc2235_sensor(sd);
 
-	dev_dbg(&client->dev, "%s...\n", __func__);
-
 	dev->platform_data->csi_cfg(sd, 0);
 
 	v4l2_device_unregister_subdev(sd);
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index d5fa3ea624ef..708288d6addc 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -144,9 +144,7 @@ static int ov2680_g_fnumber_range(struct v4l2_subdev *sd, s32 *val)
 static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 {
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
-	struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	*val = ov2680_res[dev->fmt_idx].bin_factor_x;
 
 	return 0;
@@ -155,10 +153,8 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
 static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val)
 {
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
-	struct i2c_client *client = v4l2_get_subdevdata(sd);
 
 	*val = ov2680_res[dev->fmt_idx].bin_factor_y;
-	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	return 0;
 }
 
@@ -173,7 +169,6 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
 	u16 reg_val;
 	int ret;
 
-	dev_dbg(&client->dev,  "++++%s\n", __func__);
 	if (!info)
 		return -EINVAL;
 
@@ -1232,8 +1227,6 @@ static int ov2680_remove(struct i2c_client *client)
 	struct v4l2_subdev *sd = i2c_get_clientdata(client);
 	struct ov2680_device *dev = to_ov2680_sensor(sd);
 
-	dev_dbg(&client->dev, "%s...\n", __func__);
-
 	dev->platform_data->csi_cfg(sd, 0);
 
 	v4l2_device_unregister_subdev(sd);
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
index 69409f8447b5..4ed268e5e1b7 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
@@ -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, "%s...\n", __func__);
-
 	dev->platform_data->csi_cfg(sd, 0);
 	v4l2_ctrl_handler_free(&dev->ctrl_handler);
 	v4l2_device_unregister_subdev(sd);
-- 
2.31.1




^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-28 18:08 ` [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks Deepak R Varma
@ 2021-04-29  7:06   ` Fabio Aiuto
  2021-04-29 11:49     ` Deepak R Varma
  0 siblings, 1 reply; 15+ messages in thread
From: Fabio Aiuto @ 2021-04-29  7:06 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman,
	linux-media, linux-staging, linux-kernel

Hi Deepak,

On Wed, Apr 28, 2021 at 11:38:45PM +0530, Deepak R Varma wrote:
> Reformat code comment blocks according to the coding style guidelines.
> This resolves different checkpatch script WARNINGs around block comments.
> 
> Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
> 
> Changes since v3:
>    - Include additional header files in the clean up
> Changes since v2:
>    - Tag Fabio Auito for the patch suggestion
> 
> Changes in v1:
>    - implement following changes suggested by Fabio Aiuto
>        a. Corrected commenting style
>        b. Similar style implemented for other comment blocks in
>           the same files.
> 
>  .../media/atomisp/i2c/atomisp-gc2235.c        | 19 ++++---
>  .../atomisp/i2c/atomisp-libmsrlisthelper.c    |  6 ++-
>  .../media/atomisp/i2c/atomisp-mt9m114.c       | 49 ++++++++++++-------
>  .../media/atomisp/i2c/atomisp-ov2680.c        | 20 +++++---
>  drivers/staging/media/atomisp/i2c/mt9m114.h   |  3 +-
>  drivers/staging/media/atomisp/i2c/ov2680.h    | 10 ++--
>  6 files changed, 65 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> index 548c572d3b57..6ee6e8414f0e 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> @@ -228,7 +228,7 @@ static int gc2235_g_focal(struct v4l2_subdev *sd, s32 *val)
>  
>  static int gc2235_g_fnumber(struct v4l2_subdev *sd, s32 *val)
>  {
> -	/*const f number for imx*/
> +	/* const f number for imx */
>  	*val = (GC2235_F_NUMBER_DEFAULT_NUM << 16) | GC2235_F_NUMBER_DEM;
>  	return 0;
>  }
> @@ -427,7 +427,8 @@ static long gc2235_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
>  	return 0;
>  }
>  
> -/* This returns the exposure time being used. This should only be used
> +/*
> + * This returns the exposure time being used. This should only be used
>   * for filling in EXIF data, not for actual image processing.
>   */
>  static int gc2235_q_exposure(struct v4l2_subdev *sd, s32 *value)
> @@ -746,11 +747,12 @@ static int startup(struct v4l2_subdev *sd)
>  	int ret = 0;
>  
>  	if (is_init == 0) {
> -		/* force gc2235 to do a reset in res change, otherwise it
> -		* can not output normal after switching res. and it is not
> -		* necessary for first time run up after power on, for the sack
> -		* of performance
> -		*/
> +		/*
> +		 * force gc2235 to do a reset in res change, otherwise it
> +		 * can not output normal after switching res. and it is not
> +		 * necessary for first time run up after power on, for the sack
> +		 * of performance
> +		 */
>  		power_down(sd);
>  		power_up(sd);
>  		gc2235_write_reg_array(client, gc2235_init_settings);
> @@ -904,7 +906,8 @@ static int gc2235_s_config(struct v4l2_subdev *sd,
>  	    (struct camera_sensor_platform_data *)platform_data;
>  
>  	mutex_lock(&dev->input_lock);
> -	/* power off the module, then power on it in future
> +	/*
> +	 * power off the module, then power on it in future
>  	 * as first power on by board may not fulfill the
>  	 * power on sequqence needed by the module
>  	 */
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c b/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
> index b93c80471f22..7a20d918a9d5 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-libmsrlisthelper.c
> @@ -50,14 +50,16 @@ struct tbd_data_record_header {
>  static int set_msr_configuration(struct i2c_client *client, uint8_t *bufptr,
>  				 unsigned int size)
>  {
> -	/* The configuration data contains any number of sequences where
> +	/*
> +	 * The configuration data contains any number of sequences where
>  	 * the first byte (that is, uint8_t) that marks the number of bytes
>  	 * in the sequence to follow, is indeed followed by the indicated
>  	 * number of bytes of actual data to be written to sensor.
>  	 * By convention, the first two bytes of actual data should be
>  	 * understood as an address in the sensor address space (hibyte
>  	 * followed by lobyte) where the remaining data in the sequence
> -	 * will be written. */
> +	 * will be written.
> +	 */
>  
>  	u8 *ptr = bufptr;
>  
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> index 465fc4468442..a5f0b4848ddf 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> @@ -475,10 +475,12 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
>  	if (!dev || !dev->platform_data)
>  		return -ENODEV;
>  
> -	/* Note: current modules wire only one GPIO signal (RESET#),
> +	/*
> +	 * Note: current modules wire only one GPIO signal (RESET#),
>  	 * but the schematic wires up two to the connector.  BIOS
>  	 * versions have been unfortunately inconsistent with which
> -	 * ACPI index RESET# is on, so hit both */
> +	 * ACPI index RESET# is on, so hit both
> +	 */
>  
>  	if (flag) {
>  		ret = dev->platform_data->gpio0_ctrl(sd, 0);
> @@ -560,7 +562,7 @@ static int power_down(struct v4l2_subdev *sd)
>  	if (ret)
>  		dev_err(&client->dev, "vprog failed.\n");
>  
> -	/*according to DS, 20ms is needed after power down*/
> +	/* according to DS, 20ms is needed after power down */
>  	msleep(20);
>  
>  	return ret;
> @@ -947,7 +949,7 @@ static int mt9m114_g_focal(struct v4l2_subdev *sd, s32 *val)
>  
>  static int mt9m114_g_fnumber(struct v4l2_subdev *sd, s32 *val)
>  {
> -	/*const f number for mt9m114*/
> +	/* const f number for mt9m114 */
>  	*val = (MT9M114_F_NUMBER_DEFAULT_NUM << 16) | MT9M114_F_NUMBER_DEM;
>  	return 0;
>  }
> @@ -1008,8 +1010,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
>  		exposure->gain[1]);
>  
>  	coarse_integration = exposure->integration_time[0];
> -	/* fine_integration = ExposureTime.FineIntegrationTime; */
> -	/* FrameLengthLines = ExposureTime.FrameLengthLines; */
> +	/*
> +	 * fine_integration = ExposureTime.FineIntegrationTime;
> +	 * FrameLengthLines = ExposureTime.FrameLengthLines;
> +	 */
>  	FLines = mt9m114_res[dev->res].lines_per_frame;
>  	AnalogGain = exposure->gain[0];
>  	DigitalGain = exposure->gain[1];
> @@ -1019,8 +1023,8 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
>  		dev->first_gain = AnalogGain;
>  		dev->first_diggain = DigitalGain;
>  	}
> -	/* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) +
> -	((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8); */
> +	/* DigitalGain = 0x400 * (((u16) DigitalGain) >> 8) +		*/
> +	/* ((unsigned int)(0x400 * (((u16) DigitalGain) & 0xFF)) >>8);	*/
>  
>  	/* set frame length */
>  	if (FLines < coarse_integration + 6)
> @@ -1034,8 +1038,10 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
>  	}
>  
>  	/* set coarse integration */
> -	/* 3A provide real exposure time.
> -		should not translate to any value here. */
> +	/*
> +	 * 3A provide real exposure time.
> +	 * should not translate to any value here.
> +	 */
>  	ret = mt9m114_write_reg(client, MISENSOR_16BIT,
>  				REG_EXPO_COARSE, (u16)(coarse_integration));
>  	if (ret) {
> @@ -1044,7 +1050,7 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
>  	}
>  
>  	/*
> -	// set analog/digital gain
> +	 * set analog/digital gain
>  	switch(AnalogGain)
>  	{
>  	case 0:
> @@ -1069,8 +1075,9 @@ static long mt9m114_s_exposure(struct v4l2_subdev *sd,
>  	*/
>  	if (DigitalGain >= 16 || DigitalGain <= 1)
>  		DigitalGain = 1;
> -	/* AnalogGainToWrite =
> -		(u16)((DigitalGain << 12) | AnalogGainToWrite); */
> +	/*
> +	 * AnalogGainToWrite = (u16)((DigitalGain << 12) | AnalogGainToWrite);
> +	 */
>  	AnalogGainToWrite = (u16)((DigitalGain << 12) | (u16)AnalogGain);
>  	ret = mt9m114_write_reg(client, MISENSOR_16BIT,
>  				REG_GAIN, AnalogGainToWrite);
> @@ -1095,8 +1102,10 @@ static long mt9m114_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
>  	return 0;
>  }
>  
> -/* This returns the exposure time being used. This should only be used
> -   for filling in EXIF data, not for actual image processing. */
> +/*
> + * This returns the exposure time being used. This should only be used
> + * for filling in EXIF data, not for actual image processing.
> + */
>  static int mt9m114_g_exposure(struct v4l2_subdev *sd, s32 *value)
>  {
>  	struct i2c_client *client = v4l2_get_subdevdata(sd);
> @@ -1247,7 +1256,8 @@ static int mt9m114_s_ev(struct v4l2_subdev *sd, s32 val)
>  	s32 luma = 0x37;
>  	int err;
>  
> -	/* EV value only support -2 to 2
> +	/*
> +	 * EV value only support -2 to 2
>  	 * 0: 0x37, 1:0x47, 2:0x57, -1:0x27, -2:0x17
>  	 */
>  	if (val < -2 || val > 2)
> @@ -1295,9 +1305,10 @@ static int mt9m114_g_ev(struct v4l2_subdev *sd, s32 *val)
>  	return 0;
>  }
>  
> -/* Fake interface
> +/*
> + * Fake interface
>   * mt9m114 now can not support 3a_lock
> -*/
> + */
>  static int mt9m114_s_3a_lock(struct v4l2_subdev *sd, s32 val)
>  {
>  	aaalock = val;
> @@ -1843,7 +1854,7 @@ static int mt9m114_probe(struct i2c_client *client)
>  		return ret;
>  	}
>  
> -	/*TODO add format code here*/
> +	/* TODO add format code here */
>  	dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
>  	dev->pad.flags = MEDIA_PAD_FL_SOURCE;
>  	dev->format.code = MEDIA_BUS_FMT_SGRBG10_1X10;
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> index a51ad9843d39..d5fa3ea624ef 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> @@ -127,7 +127,7 @@ static int ov2680_g_focal(struct v4l2_subdev *sd, s32 *val)
>  
>  static int ov2680_g_fnumber(struct v4l2_subdev *sd, s32 *val)
>  {
> -	/*const f number for ov2680*/
> +	/* const f number for ov2680 */
>  
>  	*val = (OV2680_F_NUMBER_DEFAULT_NUM << 16) | OV2680_F_NUMBER_DEM;
>  	return 0;
> @@ -399,7 +399,8 @@ static long ov2680_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
>  	return 0;
>  }
>  
> -/* This returns the exposure time being used. This should only be used
> +/*
> + * This returns the exposure time being used. This should only be used
>   * for filling in EXIF data, not for actual image processing.
>   */
>  static int ov2680_q_exposure(struct v4l2_subdev *sd, s32 *value)
> @@ -727,11 +728,13 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
>  	if (!dev || !dev->platform_data)
>  		return -ENODEV;
>  
> -	/* The OV2680 documents only one GPIO input (#XSHUTDN), but
> +	/*
> +	 * The OV2680 documents only one GPIO input (#XSHUTDN), but
>  	 * existing integrations often wire two (reset/power_down)
>  	 * because that is the way other sensors work.  There is no
>  	 * way to tell how it is wired internally, so existing
> -	 * firmwares expose both and we drive them symmetrically. */
> +	 * firmwares expose both and we drive them symmetrically.
> +	 */
>  	if (flag) {
>  		ret = dev->platform_data->gpio0_ctrl(sd, 1);
>  		usleep_range(10000, 15000);
> @@ -977,7 +980,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
>  		goto err;
>  	}
>  
> -	/*recall flip functions to avoid flip registers
> +	/*
> +	 * recall flip functions to avoid flip registers
>  	 * were overridden by default setting
>  	 */
>  	if (h_flag)
> @@ -987,7 +991,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
>  
>  	v4l2_info(client, "\n%s idx %d\n", __func__, dev->fmt_idx);
>  
> -	/*ret = startup(sd);
> +	/*
> +	 * ret = startup(sd);
>  	 * if (ret)
>  	 * dev_err(&client->dev, "ov2680 startup err\n");
>  	 */
> @@ -1096,7 +1101,8 @@ static int ov2680_s_config(struct v4l2_subdev *sd,
>  	    (struct camera_sensor_platform_data *)platform_data;
>  
>  	mutex_lock(&dev->input_lock);
> -	/* power off the module, then power on it in future
> +	/*
> +	 * power off the module, then power on it in future
>  	 * as first power on by board may not fulfill the
>  	 * power on sequqence needed by the module
>  	 */
> diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
> index 787bbf59e895..aad98f37aaa6 100644
> --- a/drivers/staging/media/atomisp/i2c/mt9m114.h
> +++ b/drivers/staging/media/atomisp/i2c/mt9m114.h
> @@ -765,7 +765,8 @@ static struct misensor_reg const mt9m114_common[] = {
>  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
>  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
>  	/* LOAD = Step3-Recommended
> -	 * Patch,Errata and Sensor optimization Setting */
> +	 * Patch,Errata and Sensor optimization Setting
> +	 */

	/*
	 * LOAD = Step3-Recommended

:(


>  	{MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
>  	{MISENSOR_16BIT, 0x316C, 0x8270}, /* DAC_TXLO */
>  	{MISENSOR_16BIT, 0x3ED0, 0x2305}, /* DAC_LD_4_5 */
> diff --git a/drivers/staging/media/atomisp/i2c/ov2680.h b/drivers/staging/media/atomisp/i2c/ov2680.h
> index 49920245e064..4d43b45915e5 100644
> --- a/drivers/staging/media/atomisp/i2c/ov2680.h
> +++ b/drivers/staging/media/atomisp/i2c/ov2680.h
> @@ -459,8 +459,8 @@ static struct ov2680_reg const ov2680_656x496_30fps[] = {
>  };
>  
>  /*
> -* 800x600 30fps  VBlanking 1lane 10Bit (binning)
> -*/
> + * 800x600 30fps  VBlanking 1lane 10Bit (binning)
> + */
>  static struct ov2680_reg const ov2680_720x592_30fps[] = {
>  	{0x3086, 0x01},
>  	{0x3501, 0x26},
> @@ -504,8 +504,8 @@ static struct ov2680_reg const ov2680_720x592_30fps[] = {
>  };
>  
>  /*
> -* 800x600 30fps  VBlanking 1lane 10Bit (binning)
> -*/
> + * 800x600 30fps  VBlanking 1lane 10Bit (binning)
> + */
>  static struct ov2680_reg const ov2680_800x600_30fps[] = {
>  	{0x3086, 0x01},
>  	{0x3501, 0x26},
> @@ -634,7 +634,7 @@ static struct ov2680_reg const ov2680_1296x976_30fps[] = {
>  
>  /*
>   *   1456*1096 30fps  VBlanking 1lane 10bit(no-scaling)
> -*/
> + */
>  static struct ov2680_reg const ov2680_1456x1096_30fps[] = {
>  	{0x3086, 0x00},
>  	{0x3501, 0x48},
> -- 
> 2.31.1
> 
> 
> 
> 

thank you,

fabio

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-29  7:06   ` Fabio Aiuto
@ 2021-04-29 11:49     ` Deepak R Varma
  2021-04-30 10:04       ` Hans Verkuil
  0 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-04-29 11:49 UTC (permalink / raw)
  To: Fabio Aiuto
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman,
	linux-media, linux-staging, linux-kernel

On Thu, Apr 29, 2021 at 09:06:12AM +0200, Fabio Aiuto wrote:
> Hi Deepak,

Hello Fabio :)

> 
> On Wed, Apr 28, 2021 at 11:38:45PM +0530, Deepak R Varma wrote:
> > Reformat code comment blocks according to the coding style guidelines.
> > This resolves different checkpatch script WARNINGs around block comments.
> > 
> > Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> > 
> > Changes since v3:
> >    - Include additional header files in the clean up
> > Changes since v2:
> >    - Tag Fabio Auito for the patch suggestion
> > 
> > diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
> > index 787bbf59e895..aad98f37aaa6 100644
> > --- a/drivers/staging/media/atomisp/i2c/mt9m114.h
> > +++ b/drivers/staging/media/atomisp/i2c/mt9m114.h
> > @@ -765,7 +765,8 @@ static struct misensor_reg const mt9m114_common[] = {
> >  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
> >  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
> >  	/* LOAD = Step3-Recommended
> > -	 * Patch,Errata and Sensor optimization Setting */
> > +	 * Patch,Errata and Sensor optimization Setting
> > +	 */
> 
> 	/*
> 	 * LOAD = Step3-Recommended
> 
> :(

oops... sorry for the oversight. Not sure how I missed it.
I will wait for any other feedback on other patches and send
in a corrected version shortly.

Thank you,
deepak.



> 
> 
> >  	{MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
> > 
> 
> thank you,
> 
> fabio



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-29 11:49     ` Deepak R Varma
@ 2021-04-30 10:04       ` Hans Verkuil
  2021-04-30 11:15         ` Deepak R Varma
  0 siblings, 1 reply; 15+ messages in thread
From: Hans Verkuil @ 2021-04-30 10:04 UTC (permalink / raw)
  To: Deepak R Varma, Fabio Aiuto
  Cc: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman,
	linux-media, linux-staging, linux-kernel

On 29/04/2021 13:49, Deepak R Varma wrote:
> On Thu, Apr 29, 2021 at 09:06:12AM +0200, Fabio Aiuto wrote:
>> Hi Deepak,
> 
> Hello Fabio :)
> 
>>
>> On Wed, Apr 28, 2021 at 11:38:45PM +0530, Deepak R Varma wrote:
>>> Reformat code comment blocks according to the coding style guidelines.
>>> This resolves different checkpatch script WARNINGs around block comments.
>>>
>>> Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
>>> Signed-off-by: Deepak R Varma <drv@mailo.com>
>>> ---
>>>
>>> Changes since v3:
>>>    - Include additional header files in the clean up
>>> Changes since v2:
>>>    - Tag Fabio Auito for the patch suggestion
>>>
>>> diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
>>> index 787bbf59e895..aad98f37aaa6 100644
>>> --- a/drivers/staging/media/atomisp/i2c/mt9m114.h
>>> +++ b/drivers/staging/media/atomisp/i2c/mt9m114.h
>>> @@ -765,7 +765,8 @@ static struct misensor_reg const mt9m114_common[] = {
>>>  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
>>>  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
>>>  	/* LOAD = Step3-Recommended
>>> -	 * Patch,Errata and Sensor optimization Setting */
>>> +	 * Patch,Errata and Sensor optimization Setting
>>> +	 */
>>
>> 	/*
>> 	 * LOAD = Step3-Recommended
>>
>> :(
> 
> oops... sorry for the oversight. Not sure how I missed it.
> I will wait for any other feedback on other patches and send
> in a corrected version shortly.

I've fixed this up myself.

I'm taking this series and make a PR for this, wrapping up these
atomisp cleanups.

If you plan any more cleanups, then please do this on top of this
branch: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.14-out1

That contains all pending cleanups for staging/media.

Regards,

	Hans

> 
> Thank you,
> deepak.
> 
> 
> 
>>
>>
>>>  	{MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
>>>
>>
>> thank you,
>>
>> fabio
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-30 10:04       ` Hans Verkuil
@ 2021-04-30 11:15         ` Deepak R Varma
  2021-04-30 12:27           ` Deepak R Varma
  0 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-04-30 11:15 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Fabio Aiuto, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, linux-media, linux-staging, linux-kernel

On Fri, Apr 30, 2021 at 12:04:33PM +0200, Hans Verkuil wrote:
> On 29/04/2021 13:49, Deepak R Varma wrote:
> > On Thu, Apr 29, 2021 at 09:06:12AM +0200, Fabio Aiuto wrote:
> >> Hi Deepak,
> > 
> > Hello Fabio :)
> > 
> >>
> >> On Wed, Apr 28, 2021 at 11:38:45PM +0530, Deepak R Varma wrote:
> >>> Reformat code comment blocks according to the coding style guidelines.
> >>> This resolves different checkpatch script WARNINGs around block comments.
> >>>
> >>> Suggested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
> >>> Signed-off-by: Deepak R Varma <drv@mailo.com>
> >>> ---
> >>>
> >>> Changes since v3:
> >>>    - Include additional header files in the clean up
> >>> Changes since v2:
> >>>    - Tag Fabio Auito for the patch suggestion
> >>>
> >>> diff --git a/drivers/staging/media/atomisp/i2c/mt9m114.h b/drivers/staging/media/atomisp/i2c/mt9m114.h
> >>> index 787bbf59e895..aad98f37aaa6 100644
> >>> --- a/drivers/staging/media/atomisp/i2c/mt9m114.h
> >>> +++ b/drivers/staging/media/atomisp/i2c/mt9m114.h
> >>> @@ -765,7 +765,8 @@ static struct misensor_reg const mt9m114_common[] = {
> >>>  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
> >>>  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
> >>>  	/* LOAD = Step3-Recommended
> >>> -	 * Patch,Errata and Sensor optimization Setting */
> >>> +	 * Patch,Errata and Sensor optimization Setting
> >>> +	 */
> >>
> >> 	/*
> >> 	 * LOAD = Step3-Recommended
> >>
> >> :(
> > 
> > oops... sorry for the oversight. Not sure how I missed it.
> > I will wait for any other feedback on other patches and send
> > in a corrected version shortly.
> 
> I've fixed this up myself.
> 
> I'm taking this series and make a PR for this, wrapping up these
> atomisp cleanups.
> 
> If you plan any more cleanups, then please do this on top of this
> branch: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.14-out1
> 
> That contains all pending cleanups for staging/media.

Thank you Hans and everyone. Appreciate your time, comments and patience. I
understand this entire patch series is acceptable for your consideration and
that I can now move on to other changes.

I will be sending additional clean up patches and I will base those on top of the
mentioned branch.

Have a good one.
deepak.

> 
> Regards,
> 
> 	Hans
> 
> > 
> > Thank you,
> > deepak.
> > 
> > 
> > 
> >>
> >>
> >>>  	{MISENSOR_16BIT, 0x316A, 0x8270}, /* DAC_TXLO_ROW */
> >>>
> >>
> >> thank you,
> >>
> >> fabio
> > 
> > 
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-30 11:15         ` Deepak R Varma
@ 2021-04-30 12:27           ` Deepak R Varma
  2021-04-30 12:29             ` Hans Verkuil
  0 siblings, 1 reply; 15+ messages in thread
From: Deepak R Varma @ 2021-04-30 12:27 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Fabio Aiuto, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, linux-media, linux-staging, linux-kernel

On Fri, Apr 30, 2021 at 04:45:56PM +0530, Deepak R Varma wrote:
> On Fri, Apr 30, 2021 at 12:04:33PM +0200, Hans Verkuil wrote:
> > On 29/04/2021 13:49, Deepak R Varma wrote:
> > > On Thu, Apr 29, 2021 at 09:06:12AM +0200, Fabio Aiuto wrote:
> > >> Hi Deepak,
> > >>>  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
> > >>>  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
> > >>>  	/* LOAD = Step3-Recommended
> > >>> -	 * Patch,Errata and Sensor optimization Setting */
> > >>> +	 * Patch,Errata and Sensor optimization Setting
> > >>> +	 */
> > >>
> > >> 	/*
> > >> 	 * LOAD = Step3-Recommended
> > >>
> > >> :(
> > > 
> > > oops... sorry for the oversight. Not sure how I missed it.
> > > I will wait for any other feedback on other patches and send
> > > in a corrected version shortly.
> > 
> > I've fixed this up myself.
> > 
> > I'm taking this series and make a PR for this, wrapping up these
> > atomisp cleanups.
> > 
> > If you plan any more cleanups, then please do this on top of this
> > branch: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.14-out1
> > 
> > That contains all pending cleanups for staging/media.
> 
> Thank you Hans and everyone. Appreciate your time, comments and patience. I
> understand this entire patch series is acceptable for your consideration and
> that I can now move on to other changes.
> 
> I will be sending additional clean up patches and I will base those on top of the
> mentioned branch.

Hello Hans,
I have cloned media_tree repository and checked out branch for-v5.14-out1

Is it okay for me to start my next patch in this branch? I do not need for
you the last patch set to be applied to the git tree, correct?

Thank you,
deepak.

> 
> Have a good one.
> deepak.
> 
> > 
> > Regards,
> > 
> > 	Hans
> > 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks
  2021-04-30 12:27           ` Deepak R Varma
@ 2021-04-30 12:29             ` Hans Verkuil
  0 siblings, 0 replies; 15+ messages in thread
From: Hans Verkuil @ 2021-04-30 12:29 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Fabio Aiuto, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, linux-media, linux-staging, linux-kernel

On 30/04/2021 14:27, Deepak R Varma wrote:
> On Fri, Apr 30, 2021 at 04:45:56PM +0530, Deepak R Varma wrote:
>> On Fri, Apr 30, 2021 at 12:04:33PM +0200, Hans Verkuil wrote:
>>> On 29/04/2021 13:49, Deepak R Varma wrote:
>>>> On Thu, Apr 29, 2021 at 09:06:12AM +0200, Fabio Aiuto wrote:
>>>>> Hi Deepak,
>>>>>>  	{MISENSOR_16BIT, 0xC868, 0x0280}, /* cam_output_width = 952 */
>>>>>>  	{MISENSOR_16BIT, 0xC86A, 0x01E0}, /* cam_output_height = 538 */
>>>>>>  	/* LOAD = Step3-Recommended
>>>>>> -	 * Patch,Errata and Sensor optimization Setting */
>>>>>> +	 * Patch,Errata and Sensor optimization Setting
>>>>>> +	 */
>>>>>
>>>>> 	/*
>>>>> 	 * LOAD = Step3-Recommended
>>>>>
>>>>> :(
>>>>
>>>> oops... sorry for the oversight. Not sure how I missed it.
>>>> I will wait for any other feedback on other patches and send
>>>> in a corrected version shortly.
>>>
>>> I've fixed this up myself.
>>>
>>> I'm taking this series and make a PR for this, wrapping up these
>>> atomisp cleanups.
>>>
>>> If you plan any more cleanups, then please do this on top of this
>>> branch: https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.14-out1
>>>
>>> That contains all pending cleanups for staging/media.
>>
>> Thank you Hans and everyone. Appreciate your time, comments and patience. I
>> understand this entire patch series is acceptable for your consideration and
>> that I can now move on to other changes.
>>
>> I will be sending additional clean up patches and I will base those on top of the
>> mentioned branch.
> 
> Hello Hans,
> I have cloned media_tree repository and checked out branch for-v5.14-out1
> 
> Is it okay for me to start my next patch in this branch? I do not need for
> you the last patch set to be applied to the git tree, correct?
> 

Correct.

	Hans

> Thank you,
> deepak.
> 
>>
>> Have a good one.
>> deepak.
>>
>>>
>>> Regards,
>>>
>>> 	Hans
>>>
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names
  2021-04-28 18:07 ` [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names Deepak R Varma
@ 2021-05-17 13:44   ` Mauro Carvalho Chehab
  2021-05-19 16:08     ` Deepak R Varma
  0 siblings, 1 reply; 15+ messages in thread
From: Mauro Carvalho Chehab @ 2021-05-17 13:44 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-staging,
	linux-kernel

Em Wed, 28 Apr 2021 23:37:54 +0530
Deepak R Varma <drv@mailo.com> escreveu:

> Replace hard coded function names from the debug print strings by
> standard __func__ predefined identifier. This resolves following
> checkpatch script WARNING:
> Prefer using '"%s...", __func__' to using function's name, in a string.
> 
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
> 
> Changes since v3:
>    - None.
> Changes since v2:
>    - None.
> Changes since v1:
>    - None.

Huh? Why are you sending a new version when there's no difference
from the past ones?

> 
>  .../staging/media/atomisp/i2c/atomisp-gc0310.c   |  2 +-
>  .../staging/media/atomisp/i2c/atomisp-gc2235.c   |  2 +-
>  .../staging/media/atomisp/i2c/atomisp-lm3554.c   |  2 +-
>  .../staging/media/atomisp/i2c/atomisp-ov2680.c   | 16 ++++++++--------
>  .../staging/media/atomisp/i2c/atomisp-ov2722.c   |  2 +-
>  5 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> index d68a2bcc9ae1..b572551f1a0d 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> @@ -1292,7 +1292,7 @@ static int gc0310_remove(struct i2c_client *client)
>  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
>  	struct gc0310_device *dev = to_gc0310_sensor(sd);
>  
> -	dev_dbg(&client->dev, "gc0310_remove...\n");
> +	dev_dbg(&client->dev, "%s...\n", __func__);
>  

As Dan already pointed, please delete this and other
dev_dbg() that are just tracing functions without any other
real meaning. If one needs that, ftrace could be used.



>  	dev->platform_data->csi_cfg(sd, 0);
>  
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> index e722c639b60d..548c572d3b57 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> @@ -1034,7 +1034,7 @@ static int gc2235_remove(struct i2c_client *client)
>  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
>  	struct gc2235_device *dev = to_gc2235_sensor(sd);
>  
> -	dev_dbg(&client->dev, "gc2235_remove...\n");
> +	dev_dbg(&client->dev, "%s...\n", __func__);
>  
>  	dev->platform_data->csi_cfg(sd, 0);
>  
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> index 7ca7378b1859..ab10fd98dbc0 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> @@ -680,7 +680,7 @@ static int lm3554_detect(struct v4l2_subdev *sd)
>  	int ret;
>  
>  	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
> -		dev_err(&client->dev, "lm3554_detect i2c error\n");
> +		dev_err(&client->dev, "%s i2c error\n", __func__);
>  		return -ENODEV;
>  	}
>  
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> index f167781e258a..a51ad9843d39 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> @@ -146,7 +146,7 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
>  	struct ov2680_device *dev = to_ov2680_sensor(sd);
>  	struct i2c_client *client = v4l2_get_subdevdata(sd);
>  
> -	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_x\n");
> +	dev_dbg(&client->dev,  "++++%s\n", __func__);
>  	*val = ov2680_res[dev->fmt_idx].bin_factor_x;
>  
>  	return 0;
> @@ -158,7 +158,7 @@ static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val)
>  	struct i2c_client *client = v4l2_get_subdevdata(sd);
>  
>  	*val = ov2680_res[dev->fmt_idx].bin_factor_y;
> -	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_y\n");
> +	dev_dbg(&client->dev,  "++++%s\n", __func__);
>  	return 0;
>  }
>  
> @@ -173,7 +173,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
>  	u16 reg_val;
>  	int ret;
>  
> -	dev_dbg(&client->dev,  "++++ov2680_get_intg_factor\n");
> +	dev_dbg(&client->dev,  "++++%s\n", __func__);
>  	if (!info)
>  		return -EINVAL;
>  
> @@ -251,8 +251,8 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
>  	int ret, exp_val;
>  
>  	dev_dbg(&client->dev,
> -		"+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",
> -		coarse_itg, gain, digitgain);
> +		"+++++++%s coarse_itg %d, gain %d, digitgain %d++\n",
> +		__func__, coarse_itg, gain, digitgain);

This one for instance, is not a plain trace, so it could make
sense to be kept, but please remove those "+++..."  sequences
from the string, as this has no meaning. So, just:

 	dev_dbg(&client->dev,
		"%s: coarse_itg %d, gain %d, digitgain %d\n",
		__func__, coarse_itg, gain, digitgain);

would be enough.

>  
>  	vts = ov2680_res[dev->fmt_idx].lines_per_frame;
>  
> @@ -1060,9 +1060,9 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable)
>  
>  	mutex_lock(&dev->input_lock);
>  	if (enable)
> -		dev_dbg(&client->dev, "ov2680_s_stream one\n");
> +		dev_dbg(&client->dev, "%s one\n", __func__);

There's a typo here:

	one -> on

Please fix.

>  	else
> -		dev_dbg(&client->dev, "ov2680_s_stream off\n");
> +		dev_dbg(&client->dev, "%s off\n", __func__);

Btw, the entire logic above could be re-written as:

	dev_dbg(&client->dev, "%s: %s\n", __func__,
		enable ? "on" : "off");

>  
>  	ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM,
>  			       enable ? OV2680_START_STREAMING :
> @@ -1226,7 +1226,7 @@ static int ov2680_remove(struct i2c_client *client)
>  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
>  	struct ov2680_device *dev = to_ov2680_sensor(sd);
>  
> -	dev_dbg(&client->dev, "ov2680_remove...\n");
> +	dev_dbg(&client->dev, "%s...\n", __func__);
>  
>  	dev->platform_data->csi_cfg(sd, 0);
>  
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> index d046a9804f63..69409f8447b5 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> @@ -1175,7 +1175,7 @@ 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_dbg(&client->dev, "%s...\n", __func__);
>  
>  	dev->platform_data->csi_cfg(sd, 0);
>  	v4l2_ctrl_handler_free(&dev->ctrl_handler);



Thanks,
Mauro

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names
  2021-05-17 13:44   ` Mauro Carvalho Chehab
@ 2021-05-19 16:08     ` Deepak R Varma
  0 siblings, 0 replies; 15+ messages in thread
From: Deepak R Varma @ 2021-05-19 16:08 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Sakari Ailus, Greg Kroah-Hartman, linux-media, linux-staging,
	linux-kernel

On Mon, May 17, 2021 at 03:44:48PM +0200, Mauro Carvalho Chehab wrote:
> Em Wed, 28 Apr 2021 23:37:54 +0530
> Deepak R Varma <drv@mailo.com> escreveu:
> 
> > Replace hard coded function names from the debug print strings by
> > standard __func__ predefined identifier. This resolves following
> > checkpatch script WARNING:
> > Prefer using '"%s...", __func__' to using function's name, in a string.
> > 
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> > 
> > Changes since v3:
> >    - None.
> > Changes since v2:
> >    - None.
> > Changes since v1:
> >    - None.
> 
> Huh? Why are you sending a new version when there's no difference
> from the past ones?

Sorry, I thought I have to resend the whole patch set so that all the
patches have the same version history. Are you saying I just resend the
ones that required a change? No need to include those that do not have any
comments / feedback or are acked?

> 
> > 
> >  .../staging/media/atomisp/i2c/atomisp-gc0310.c   |  2 +-
> >  .../staging/media/atomisp/i2c/atomisp-gc2235.c   |  2 +-
> >  .../staging/media/atomisp/i2c/atomisp-lm3554.c   |  2 +-
> >  .../staging/media/atomisp/i2c/atomisp-ov2680.c   | 16 ++++++++--------
> >  .../staging/media/atomisp/i2c/atomisp-ov2722.c   |  2 +-
> >  5 files changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > index d68a2bcc9ae1..b572551f1a0d 100644
> > --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > @@ -1292,7 +1292,7 @@ static int gc0310_remove(struct i2c_client *client)
> >  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
> >  	struct gc0310_device *dev = to_gc0310_sensor(sd);
> >  
> > -	dev_dbg(&client->dev, "gc0310_remove...\n");
> > +	dev_dbg(&client->dev, "%s...\n", __func__);
> >  
> 
> As Dan already pointed, please delete this and other
> dev_dbg() that are just tracing functions without any other
> real meaning. If one needs that, ftrace could be used.

I have made this correction in a separate patch send afterwards. I will
confirm if this file was included. If not, I will include this in the next
version. 

> 
> 
> 
> >  	dev->platform_data->csi_cfg(sd, 0);
> >  
> > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > index e722c639b60d..548c572d3b57 100644
> > --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > @@ -1034,7 +1034,7 @@ static int gc2235_remove(struct i2c_client *client)
> >  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
> >  	struct gc2235_device *dev = to_gc2235_sensor(sd);
> >  
> > -	dev_dbg(&client->dev, "gc2235_remove...\n");
> > +	dev_dbg(&client->dev, "%s...\n", __func__);
> >  
> >  	dev->platform_data->csi_cfg(sd, 0);
> >  
> > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> > index 7ca7378b1859..ab10fd98dbc0 100644
> > --- a/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> > +++ b/drivers/staging/media/atomisp/i2c/atomisp-lm3554.c
> > @@ -680,7 +680,7 @@ static int lm3554_detect(struct v4l2_subdev *sd)
> >  	int ret;
> >  
> >  	if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
> > -		dev_err(&client->dev, "lm3554_detect i2c error\n");
> > +		dev_err(&client->dev, "%s i2c error\n", __func__);
> >  		return -ENODEV;
> >  	}
> >  
> > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > index f167781e258a..a51ad9843d39 100644
> > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > @@ -146,7 +146,7 @@ static int ov2680_g_bin_factor_x(struct v4l2_subdev *sd, s32 *val)
> >  	struct ov2680_device *dev = to_ov2680_sensor(sd);
> >  	struct i2c_client *client = v4l2_get_subdevdata(sd);
> >  
> > -	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_x\n");
> > +	dev_dbg(&client->dev,  "++++%s\n", __func__);
> >  	*val = ov2680_res[dev->fmt_idx].bin_factor_x;
> >  
> >  	return 0;
> > @@ -158,7 +158,7 @@ static int ov2680_g_bin_factor_y(struct v4l2_subdev *sd, s32 *val)
> >  	struct i2c_client *client = v4l2_get_subdevdata(sd);
> >  
> >  	*val = ov2680_res[dev->fmt_idx].bin_factor_y;
> > -	dev_dbg(&client->dev,  "++++ov2680_g_bin_factor_y\n");
> > +	dev_dbg(&client->dev,  "++++%s\n", __func__);
> >  	return 0;
> >  }
> >  
> > @@ -173,7 +173,7 @@ static int ov2680_get_intg_factor(struct i2c_client *client,
> >  	u16 reg_val;
> >  	int ret;
> >  
> > -	dev_dbg(&client->dev,  "++++ov2680_get_intg_factor\n");
> > +	dev_dbg(&client->dev,  "++++%s\n", __func__);
> >  	if (!info)
> >  		return -EINVAL;
> >  
> > @@ -251,8 +251,8 @@ static long __ov2680_set_exposure(struct v4l2_subdev *sd, int coarse_itg,
> >  	int ret, exp_val;
> >  
> >  	dev_dbg(&client->dev,
> > -		"+++++++__ov2680_set_exposure coarse_itg %d, gain %d, digitgain %d++\n",
> > -		coarse_itg, gain, digitgain);
> > +		"+++++++%s coarse_itg %d, gain %d, digitgain %d++\n",
> > +		__func__, coarse_itg, gain, digitgain);
> 
> This one for instance, is not a plain trace, so it could make
> sense to be kept, but please remove those "+++..."  sequences
> from the string, as this has no meaning. So, just:
> 
>  	dev_dbg(&client->dev,
> 		"%s: coarse_itg %d, gain %d, digitgain %d\n",
> 		__func__, coarse_itg, gain, digitgain);
> 
> would be enough.

Sounds good. I will include this in my next version.

> 
> >  
> >  	vts = ov2680_res[dev->fmt_idx].lines_per_frame;
> >  
> > @@ -1060,9 +1060,9 @@ static int ov2680_s_stream(struct v4l2_subdev *sd, int enable)
> >  
> >  	mutex_lock(&dev->input_lock);
> >  	if (enable)
> > -		dev_dbg(&client->dev, "ov2680_s_stream one\n");
> > +		dev_dbg(&client->dev, "%s one\n", __func__);
> 
> There's a typo here:
> 
> 	one -> on
> 
> Please fix.

Yes, will do.

> 
> >  	else
> > -		dev_dbg(&client->dev, "ov2680_s_stream off\n");
> > +		dev_dbg(&client->dev, "%s off\n", __func__);
> 
> Btw, the entire logic above could be re-written as:
> 
> 	dev_dbg(&client->dev, "%s: %s\n", __func__,
> 		enable ? "on" : "off");
> 
> >  
> >  	ret = ov2680_write_reg(client, 1, OV2680_SW_STREAM,
> >  			       enable ? OV2680_START_STREAMING :
> > @@ -1226,7 +1226,7 @@ static int ov2680_remove(struct i2c_client *client)
> >  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
> >  	struct ov2680_device *dev = to_ov2680_sensor(sd);
> >  
> > -	dev_dbg(&client->dev, "ov2680_remove...\n");
> > +	dev_dbg(&client->dev, "%s...\n", __func__);
> >  
> >  	dev->platform_data->csi_cfg(sd, 0);
> >  
> > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > index d046a9804f63..69409f8447b5 100644
> > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > @@ -1175,7 +1175,7 @@ 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_dbg(&client->dev, "%s...\n", __func__);
> >  
> >  	dev->platform_data->csi_cfg(sd, 0);
> >  	v4l2_ctrl_handler_free(&dev->ctrl_handler);
> 
> 
> 
> Thanks,
> Mauro

Thank you so much for the detailed review. Really appreciate your time
Mauro.

deepak.



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-19 16:08 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1619630709.git.drv@mailo.com>
2021-04-28 18:06 ` [PATCH v4 3/9] staging: media: atomisp: remove unnecessary braces Deepak R Varma
2021-04-28 18:07 ` [PATCH v4 4/9] staging: media: atomisp: use __func__ over function names Deepak R Varma
2021-05-17 13:44   ` Mauro Carvalho Chehab
2021-05-19 16:08     ` Deepak R Varma
2021-04-28 18:08 ` [PATCH v4 5/9] staging: media: atomisp: reformat code comment blocks Deepak R Varma
2021-04-29  7:06   ` Fabio Aiuto
2021-04-29 11:49     ` Deepak R Varma
2021-04-30 10:04       ` Hans Verkuil
2021-04-30 11:15         ` Deepak R Varma
2021-04-30 12:27           ` Deepak R Varma
2021-04-30 12:29             ` Hans Verkuil
2021-04-28 18:09 ` [PATCH v4 6/9] staging: media: atomisp: fix CamelCase variable naming Deepak R Varma
2021-04-28 18:09 ` [PATCH v4 7/9] staging: media: atomisp: replace raw pr_*() by dev_dbg() Deepak R Varma
2021-04-28 18:10 ` [PATCH v4 8/9] staging: media: atomisp: remove unnecessary pr_info calls Deepak R Varma
2021-04-28 18:10 ` [PATCH v4 9/9] staging: media: atomisp: remove unwanted dev_*() calls Deepak R Varma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).