linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations.
@ 2017-02-28 19:52 Alexander Kapshuk
  2017-02-28 20:34 ` Joe Perches
  2017-03-01  7:56 ` Greg KH
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Kapshuk @ 2017-02-28 19:52 UTC (permalink / raw)
  To: thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel, Alexander Kapshuk

Use a single fmt string with appropriate verbs as conversion specifiers,
followed by the original string literals and the integer argument
instead of using a backslash to escape a new line embedded inbetween
quoted string literals passed as fmt arguments to dev_err() invoked in
drivers/staging/fbtft/fb_ssd1331.c.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 drivers/staging/fbtft/fb_ssd1331.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
index 26f24e3..6d03041 100644
--- a/drivers/staging/fbtft/fb_ssd1331.c
+++ b/drivers/staging/fbtft/fb_ssd1331.c
@@ -129,17 +129,19 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
 
 	for (i = 0; i < 63; i++) {
 		if (i > 0 && curves[i] < 2) {
-			dev_err(par->info->device,
-				"Illegal value in Grayscale Lookup Table at index %d. " \
-				"Must be greater than 1\n", i);
+			dev_err(par->info->device, "%s %d. %s\n",
+				"Illegal value in Grayscale Lookup Table at index",
+				i,
+				"Must be greater than 1");
 			return -EINVAL;
 		}
 		acc += curves[i];
 		tmp[i] = acc;
 		if (acc > 180) {
-			dev_err(par->info->device,
-				"Illegal value(s) in Grayscale Lookup Table. " \
-				"At index=%d, the accumulated value has exceeded 180\n", i);
+			dev_err(par->info->device, "%s%d, %s\n",
+				"Illegal value(s) in Grayscale Lookup Table. At index=",
+				i,
+				"the accumulated value has exceeded 180");
 			return -EINVAL;
 		}
 	}
-- 
2.10.2

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

* Re: [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations.
  2017-02-28 19:52 [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations Alexander Kapshuk
@ 2017-02-28 20:34 ` Joe Perches
  2017-02-28 21:03   ` Alexander Kapshuk
  2017-03-01  7:56 ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Joe Perches @ 2017-02-28 20:34 UTC (permalink / raw)
  To: Alexander Kapshuk, thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel

On Tue, 2017-02-28 at 21:52 +0200, Alexander Kapshuk wrote:
> Use a single fmt string with appropriate verbs as conversion specifiers,
> followed by the original string literals and the integer argument
> instead of using a backslash to escape a new line embedded inbetween
> quoted string literals passed as fmt arguments to dev_err() invoked in
> drivers/staging/fbtft/fb_ssd1331.c.

trivia:

> diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
> index 26f24e3..6d03041 100644
> --- a/drivers/staging/fbtft/fb_ssd1331.c
> +++ b/drivers/staging/fbtft/fb_ssd1331.c
> @@ -129,17 +129,19 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
>  
>  	for (i = 0; i < 63; i++) {
>  		if (i > 0 && curves[i] < 2) {
> -			dev_err(par->info->device,
> -				"Illegal value in Grayscale Lookup Table at index %d. " \
> -				"Must be greater than 1\n", i);
> +			dev_err(par->info->device, "%s %d. %s\n",
> +				"Illegal value in Grayscale Lookup Table at index",

Most prefer the use of invalid not illegal.

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

* Re: [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations.
  2017-02-28 20:34 ` Joe Perches
@ 2017-02-28 21:03   ` Alexander Kapshuk
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kapshuk @ 2017-02-28 21:03 UTC (permalink / raw)
  To: Joe Perches; +Cc: thomas.petazzoni, noralf, Greg KH, devel, linux-kernel

On Tue, Feb 28, 2017 at 10:34 PM, Joe Perches <joe@perches.com> wrote:
> On Tue, 2017-02-28 at 21:52 +0200, Alexander Kapshuk wrote:
>> Use a single fmt string with appropriate verbs as conversion specifiers,
>> followed by the original string literals and the integer argument
>> instead of using a backslash to escape a new line embedded inbetween
>> quoted string literals passed as fmt arguments to dev_err() invoked in
>> drivers/staging/fbtft/fb_ssd1331.c.
>
> trivia:
>
>> diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
>> index 26f24e3..6d03041 100644
>> --- a/drivers/staging/fbtft/fb_ssd1331.c
>> +++ b/drivers/staging/fbtft/fb_ssd1331.c
>> @@ -129,17 +129,19 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
>>
>>       for (i = 0; i < 63; i++) {
>>               if (i > 0 && curves[i] < 2) {
>> -                     dev_err(par->info->device,
>> -                             "Illegal value in Grayscale Lookup Table at index %d. " \
>> -                             "Must be greater than 1\n", i);
>> +                     dev_err(par->info->device, "%s %d. %s\n",
>> +                             "Illegal value in Grayscale Lookup Table at index",
>
> Most prefer the use of invalid not illegal.
>

Thanks for your feedback.

I don't mind substituting invalid for illegal, unless the maintainers
preferred to do that themselves instead.
My patch was addressing a checkpatch.pl warning only.

I'll wait a bit more to hear from the maintainers, before going ahead
and sending another patch in.

Thanks.

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

* Re: [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations.
  2017-02-28 19:52 [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations Alexander Kapshuk
  2017-02-28 20:34 ` Joe Perches
@ 2017-03-01  7:56 ` Greg KH
  2017-03-04  9:00   ` Alexander Kapshuk
  1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2017-03-01  7:56 UTC (permalink / raw)
  To: Alexander Kapshuk; +Cc: thomas.petazzoni, noralf, devel, linux-kernel

On Tue, Feb 28, 2017 at 09:52:44PM +0200, Alexander Kapshuk wrote:
> Use a single fmt string with appropriate verbs as conversion specifiers,
> followed by the original string literals and the integer argument
> instead of using a backslash to escape a new line embedded inbetween
> quoted string literals passed as fmt arguments to dev_err() invoked in
> drivers/staging/fbtft/fb_ssd1331.c.
> 
> Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
> ---
>  drivers/staging/fbtft/fb_ssd1331.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
> index 26f24e3..6d03041 100644
> --- a/drivers/staging/fbtft/fb_ssd1331.c
> +++ b/drivers/staging/fbtft/fb_ssd1331.c
> @@ -129,17 +129,19 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
>  
>  	for (i = 0; i < 63; i++) {
>  		if (i > 0 && curves[i] < 2) {
> -			dev_err(par->info->device,
> -				"Illegal value in Grayscale Lookup Table at index %d. " \
> -				"Must be greater than 1\n", i);
> +			dev_err(par->info->device, "%s %d. %s\n",
> +				"Illegal value in Grayscale Lookup Table at index",
> +				i,
> +				"Must be greater than 1");

Huh?  This should just be:
				"Illegal value in Grayscale Lookup Table at index %d. Must be greater than 1\n",
				i);
Don't split the string for no good reason.

>  			return -EINVAL;
>  		}
>  		acc += curves[i];
>  		tmp[i] = acc;
>  		if (acc > 180) {
> -			dev_err(par->info->device,
> -				"Illegal value(s) in Grayscale Lookup Table. " \
> -				"At index=%d, the accumulated value has exceeded 180\n", i);
> +			dev_err(par->info->device, "%s%d, %s\n",
> +				"Illegal value(s) in Grayscale Lookup Table. At index=",
> +				i,
> +				"the accumulated value has exceeded 180");

Same here.

please fix.

thanks,

greg k-h

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

* [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations
  2017-03-01  7:56 ` Greg KH
@ 2017-03-04  9:00   ` Alexander Kapshuk
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kapshuk @ 2017-03-04  9:00 UTC (permalink / raw)
  To: thomas.petazzoni, noralf; +Cc: gregkh, devel, linux-kernel, Alexander Kapshuk

Use a single string literal as the fmt argument passed to dev_err()
instead of multiple string literals split with an embedded backslash
character.

Signed-off-by: Alexander Kapshuk <alexander.kapshuk@gmail.com>
---
 drivers/staging/fbtft/fb_ssd1331.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fbtft/fb_ssd1331.c b/drivers/staging/fbtft/fb_ssd1331.c
index 26f24e3..9aa9864 100644
--- a/drivers/staging/fbtft/fb_ssd1331.c
+++ b/drivers/staging/fbtft/fb_ssd1331.c
@@ -130,16 +130,16 @@ static int set_gamma(struct fbtft_par *par, u32 *curves)
 	for (i = 0; i < 63; i++) {
 		if (i > 0 && curves[i] < 2) {
 			dev_err(par->info->device,
-				"Illegal value in Grayscale Lookup Table at index %d. " \
-				"Must be greater than 1\n", i);
+				"Illegal value in Grayscale Lookup Table at index %d. Must be greater than 1\n",
+				i);
 			return -EINVAL;
 		}
 		acc += curves[i];
 		tmp[i] = acc;
 		if (acc > 180) {
 			dev_err(par->info->device,
-				"Illegal value(s) in Grayscale Lookup Table. " \
-				"At index=%d, the accumulated value has exceeded 180\n", i);
+				"Illegal value(s) in Grayscale Lookup Table. At index=%d, the accumulated value has exceeded 180\n",
+				i);
 			return -EINVAL;
 		}
 	}
-- 
2.10.2

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

end of thread, other threads:[~2017-03-04  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-28 19:52 [PATCH] staging/fbtft: Hush checkpatch.pl warning about unnecessary line continuations Alexander Kapshuk
2017-02-28 20:34 ` Joe Perches
2017-02-28 21:03   ` Alexander Kapshuk
2017-03-01  7:56 ` Greg KH
2017-03-04  9:00   ` Alexander Kapshuk

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).