All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging/media: lirc: style fix - replace hard-coded function names
@ 2017-11-26 19:49 Martin Homuth
  2017-11-28 13:18 ` Greg KH
  2017-11-28 17:47 ` [PATCH Resend] staging: media: " Martin Homuth
  0 siblings, 2 replies; 4+ messages in thread
From: Martin Homuth @ 2017-11-26 19:49 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media, devel

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

This patch fixes the remaining coding style warnings in the lirc module.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

[-- Attachment #2: 0001-lirc-style-fix-replace-hard-coded-function-names.patch --]
[-- Type: text/x-patch, Size: 1678 bytes --]

>From f11f24667ba6696cb71ac33a67fc0c7d3b4cd542 Mon Sep 17 00:00:00 2001
From: Martin Homuth <martin.homuth@emlix.com>
Date: Sun, 26 Nov 2017 20:14:33 +0100
Subject: [PATCH] lirc: style fix - replace hard-coded function names

Instead of hard coding the function name the __func__ variable
should be used.

Signed-off-by: Martin Homuth <martin.homuth@emlix.com>
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	unsigned int m;
 	DECLARE_WAITQUEUE(wait, current);
 
-	dev_dbg(ir->dev, "read called\n");
+	dev_dbg(ir->dev, "%s called\n", __func__);
 	if (n % rbuf->chunk_size) {
-		dev_dbg(ir->dev, "read result = -EINVAL\n");
+		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
 		return -EINVAL;
 	}
 
@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 				retries++;
 			}
 			if (retries >= 5) {
-				dev_err(ir->dev, "Buffer read failed!\n");
+				dev_err(ir->dev, "%s failed!\n", __func__);
 				ret = -EIO;
 			}
 		}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	put_ir_rx(rx, false);
 	set_current_state(TASK_RUNNING);
 
-	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
 		ret ? "Error" : "OK");
 
 	return ret ? ret : written;
-- 
2.13.6


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

* Re: [PATCH] staging/media: lirc: style fix - replace hard-coded function names
  2017-11-26 19:49 [PATCH] staging/media: lirc: style fix - replace hard-coded function names Martin Homuth
@ 2017-11-28 13:18 ` Greg KH
  2017-11-28 17:47 ` [PATCH Resend] staging: media: " Martin Homuth
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2017-11-28 13:18 UTC (permalink / raw)
  To: Martin Homuth; +Cc: mchehab, devel, linux-media

On Sun, Nov 26, 2017 at 08:49:42PM +0100, Martin Homuth wrote:
> This patch fixes the remaining coding style warnings in the lirc module.
> 
> It fixes the following checkpatch.pl warning:
> 
> WARNING: Prefer using '"%s...", __func__' to using 'read', this
> function's name, in a string

> >From f11f24667ba6696cb71ac33a67fc0c7d3b4cd542 Mon Sep 17 00:00:00 2001
> From: Martin Homuth <martin.homuth@emlix.com>
> Date: Sun, 26 Nov 2017 20:14:33 +0100
> Subject: [PATCH] lirc: style fix - replace hard-coded function names
> 
> Instead of hard coding the function name the __func__ variable
> should be used.
> 
> Signed-off-by: Martin Homuth <martin.homuth@emlix.com>
> ---
>  drivers/staging/media/lirc/lirc_zilog.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
> index 6bd0717bf76e..be68ee652071 100644
> --- a/drivers/staging/media/lirc/lirc_zilog.c
> +++ b/drivers/staging/media/lirc/lirc_zilog.c
> @@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
>  	unsigned int m;
>  	DECLARE_WAITQUEUE(wait, current);
>  
> -	dev_dbg(ir->dev, "read called\n");
> +	dev_dbg(ir->dev, "%s called\n", __func__);
>  	if (n % rbuf->chunk_size) {
> -		dev_dbg(ir->dev, "read result = -EINVAL\n");
> +		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
>  		return -EINVAL;
>  	}
>  
> @@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
>  				retries++;
>  			}
>  			if (retries >= 5) {
> -				dev_err(ir->dev, "Buffer read failed!\n");
> +				dev_err(ir->dev, "%s failed!\n", __func__);
>  				ret = -EIO;
>  			}
>  		}
> @@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
>  	put_ir_rx(rx, false);
>  	set_current_state(TASK_RUNNING);
>  
> -	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
> +	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
>  		ret ? "Error" : "OK");
>  
>  	return ret ? ret : written;
> -- 
> 2.13.6
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch was attached, please place it inline so that it can be
  applied directly from the email message itself.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

* [PATCH Resend] staging: media: lirc: style fix - replace hard-coded function names
  2017-11-26 19:49 [PATCH] staging/media: lirc: style fix - replace hard-coded function names Martin Homuth
  2017-11-28 13:18 ` Greg KH
@ 2017-11-28 17:47 ` Martin Homuth
  2017-11-29 11:57   ` Sean Young
  1 sibling, 1 reply; 4+ messages in thread
From: Martin Homuth @ 2017-11-28 17:47 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media, devel

This patch fixes the remaining coding style warnings in the lirc module.
Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

Signed-off-by: Martin Homuth <martin@martinhomuth.de>
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c
b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
 	unsigned int m;
 	DECLARE_WAITQUEUE(wait, current);

-	dev_dbg(ir->dev, "read called\n");
+	dev_dbg(ir->dev, "%s called\n", __func__);
 	if (n % rbuf->chunk_size) {
-		dev_dbg(ir->dev, "read result = -EINVAL\n");
+		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
 		return -EINVAL;
 	}

@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
 				retries++;
 			}
 			if (retries >= 5) {
-				dev_err(ir->dev, "Buffer read failed!\n");
+				dev_err(ir->dev, "%s failed!\n", __func__);
 				ret = -EIO;
 			}
 		}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
 	put_ir_rx(rx, false);
 	set_current_state(TASK_RUNNING);

-	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
 		ret ? "Error" : "OK");

 	return ret ? ret : written;
-- 
2.13.6

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

* Re: [PATCH Resend] staging: media: lirc: style fix - replace hard-coded function names
  2017-11-28 17:47 ` [PATCH Resend] staging: media: " Martin Homuth
@ 2017-11-29 11:57   ` Sean Young
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Young @ 2017-11-29 11:57 UTC (permalink / raw)
  To: Martin Homuth; +Cc: mchehab, linux-media, devel

On Tue, Nov 28, 2017 at 06:47:08PM +0100, Martin Homuth wrote:
> This patch fixes the remaining coding style warnings in the lirc module.
> Instead of hard coding the function name the __func__ variable
> should be used.
> 
> It fixes the following checkpatch.pl warning:
> 
> WARNING: Prefer using '"%s...", __func__' to using 'read', this
> function's name, in a string
> 
> Signed-off-by: Martin Homuth <martin@martinhomuth.de>
> ---
>  drivers/staging/media/lirc/lirc_zilog.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/lirc/lirc_zilog.c
> b/drivers/staging/media/lirc/lirc_zilog.c
> index 6bd0717bf76e..be68ee652071 100644
> --- a/drivers/staging/media/lirc/lirc_zilog.c
> +++ b/drivers/staging/media/lirc/lirc_zilog.c

I'm afraid that lirc_zilog has been re-written.

https://patchwork.linuxtv.org/patch/45189/

It hasn't been merged yet, but I suspect that is imminent.


Sean

> @@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user
> *outbuf, size_t n,
>  	unsigned int m;
>  	DECLARE_WAITQUEUE(wait, current);
> 
> -	dev_dbg(ir->dev, "read called\n");
> +	dev_dbg(ir->dev, "%s called\n", __func__);
>  	if (n % rbuf->chunk_size) {
> -		dev_dbg(ir->dev, "read result = -EINVAL\n");
> +		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
>  		return -EINVAL;
>  	}
> 
> @@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user
> *outbuf, size_t n,
>  				retries++;
>  			}
>  			if (retries >= 5) {
> -				dev_err(ir->dev, "Buffer read failed!\n");
> +				dev_err(ir->dev, "%s failed!\n", __func__);
>  				ret = -EIO;
>  			}
>  		}
> @@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user
> *outbuf, size_t n,
>  	put_ir_rx(rx, false);
>  	set_current_state(TASK_RUNNING);
> 
> -	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
> +	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
>  		ret ? "Error" : "OK");
> 
>  	return ret ? ret : written;
> -- 
> 2.13.6

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

end of thread, other threads:[~2017-11-29 11:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-26 19:49 [PATCH] staging/media: lirc: style fix - replace hard-coded function names Martin Homuth
2017-11-28 13:18 ` Greg KH
2017-11-28 17:47 ` [PATCH Resend] staging: media: " Martin Homuth
2017-11-29 11:57   ` Sean Young

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.