DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] media: atomisp-mt9m114: replace fixed function names
@ 2020-07-25  8:11 Juan Antonio Aldea-Armenteros
  2020-07-27 13:20 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Juan Antonio Aldea-Armenteros @ 2020-07-25  8:11 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Sakari Ailus, Greg Kroah-Hartman
  Cc: devel, linux-kernel, Juan Antonio Aldea-Armenteros, linux-media

There are a couple of debug messages using hardcoded function names
instead of the preferred __func__ magic constant.

Replace them:

WARNING: Prefer using '"%s...", __func__' to using 'misensor_rmw_reg', this function's name, in a string
215: FILE: ./media/atomisp/i2c/atomisp-mt9m114.c:215:
+       v4l2_err(client, "misensor_rmw_reg error exit, read failed\n");

WARNING: Prefer using '"%s...", __func__' to using 'misensor_rmw_reg', this function's name, in a string
236: FILE: ./media/atomisp/i2c/atomisp-mt9m114.c:236:
+       v4l2_err(client, "misensor_rmw_reg error exit, write failed\n");

Signed-off-by: Juan Antonio Aldea-Armenteros <juant.aldea@gmail.com>
---
 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
index 0d60918a9b19..54c24bc2061d 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
@@ -212,7 +212,7 @@ misensor_rmw_reg(struct i2c_client *client, u16 data_length, u16 reg,
 
 	err = mt9m114_read_reg(client, data_length, reg, &val);
 	if (err) {
-		v4l2_err(client, "misensor_rmw_reg error exit, read failed\n");
+		v4l2_err(client, "%s exit, read failed\n", __func__);
 		return -EINVAL;
 	}
 
@@ -233,7 +233,7 @@ misensor_rmw_reg(struct i2c_client *client, u16 data_length, u16 reg,
 
 	err = mt9m114_write_reg(client, data_length, reg, val);
 	if (err) {
-		v4l2_err(client, "misensor_rmw_reg error exit, write failed\n");
+		v4l2_err(client, "%s error exit, write failed\n", __func__);
 		return -EINVAL;
 	}
 
-- 
2.27.0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] media: atomisp-mt9m114: replace fixed function names
  2020-07-25  8:11 [PATCH] media: atomisp-mt9m114: replace fixed function names Juan Antonio Aldea-Armenteros
@ 2020-07-27 13:20 ` Dan Carpenter
  2020-07-28 14:32   ` Juan Antonio Aldea-Armenteros
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2020-07-27 13:20 UTC (permalink / raw)
  To: Juan Antonio Aldea-Armenteros
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Sakari Ailus,
	Mauro Carvalho Chehab, linux-media

On Sat, Jul 25, 2020 at 10:11:08AM +0200, Juan Antonio Aldea-Armenteros wrote:
> There are a couple of debug messages using hardcoded function names
> instead of the preferred __func__ magic constant.
> 
> Replace them:
> 
> WARNING: Prefer using '"%s...", __func__' to using 'misensor_rmw_reg', this function's name, in a string
> 215: FILE: ./media/atomisp/i2c/atomisp-mt9m114.c:215:
> +       v4l2_err(client, "misensor_rmw_reg error exit, read failed\n");
> 
> WARNING: Prefer using '"%s...", __func__' to using 'misensor_rmw_reg', this function's name, in a string
> 236: FILE: ./media/atomisp/i2c/atomisp-mt9m114.c:236:
> +       v4l2_err(client, "misensor_rmw_reg error exit, write failed\n");
> 
> Signed-off-by: Juan Antonio Aldea-Armenteros <juant.aldea@gmail.com>
> ---
>  drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> index 0d60918a9b19..54c24bc2061d 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> @@ -212,7 +212,7 @@ misensor_rmw_reg(struct i2c_client *client, u16 data_length, u16 reg,
>  
>  	err = mt9m114_read_reg(client, data_length, reg, &val);
>  	if (err) {
> -		v4l2_err(client, "misensor_rmw_reg error exit, read failed\n");
> +		v4l2_err(client, "%s exit, read failed\n", __func__);

Did you intend to delete the word "error"?

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] media: atomisp-mt9m114: replace fixed function names
  2020-07-27 13:20 ` Dan Carpenter
@ 2020-07-28 14:32   ` Juan Antonio Aldea-Armenteros
  0 siblings, 0 replies; 3+ messages in thread
From: Juan Antonio Aldea-Armenteros @ 2020-07-28 14:32 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: devel, Greg Kroah-Hartman, linux-kernel, Sakari Ailus,
	Mauro Carvalho Chehab, Juan Antonio Aldea-Armenteros,
	linux-media

No I didn't intent to. I have sent another version.

Thank you very much, Dan.

Juan Antonio Aldea-Armenteros

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-25  8:11 [PATCH] media: atomisp-mt9m114: replace fixed function names Juan Antonio Aldea-Armenteros
2020-07-27 13:20 ` Dan Carpenter
2020-07-28 14:32   ` Juan Antonio Aldea-Armenteros

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git