linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: journada720: fix Wmisleading-indentation warning
@ 2021-03-22 16:41 Arnd Bergmann
  2021-03-23  9:34 ` Daniel Thompson
  2021-03-23  9:43 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-03-22 16:41 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Kristoffer Ericson,
	Richard Purdie
  Cc: Arnd Bergmann, Sam Ravnborg, dri-devel, linux-fbdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

With gcc-11, we get a warning about code that looks correct
but badly indented:

drivers/video/backlight/jornada720_bl.c: In function ‘jornada_bl_update_status’:
drivers/video/backlight/jornada720_bl.c:66:11: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
   66 |         } else  /* turn on backlight */
      |           ^~~~

Change the formatting according to our normal conventions.

Fixes: 13a7b5dc0d17 ("backlight: Adds HP Jornada 700 series backlight driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/video/backlight/jornada720_bl.c | 44 ++++++++++++-------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c
index 996f7ba3b373..066d0dc98f60 100644
--- a/drivers/video/backlight/jornada720_bl.c
+++ b/drivers/video/backlight/jornada720_bl.c
@@ -66,30 +66,30 @@ static int jornada_bl_update_status(struct backlight_device *bd)
 	} else  /* turn on backlight */
 		PPSR |= PPC_LDD1;
 
-		/* send command to our mcu */
-		if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
-			dev_info(&bd->dev, "failed to set brightness\n");
-			ret = -ETIMEDOUT;
-			goto out;
-		}
+	/* send command to our mcu */
+	if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
+		dev_info(&bd->dev, "failed to set brightness\n");
+		ret = -ETIMEDOUT;
+		goto out;
+	}
 
-		/*
-		 * at this point we expect that the mcu has accepted
-		 * our command and is waiting for our new value
-		 * please note that maximum brightness is 255,
-		 * but due to physical layout it is equal to 0, so we simply
-		 * invert the value (MAX VALUE - NEW VALUE).
-		 */
-		if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
-			!= TXDUMMY) {
-			dev_err(&bd->dev, "set brightness failed\n");
-			ret = -ETIMEDOUT;
-		}
+	/*
+	 * at this point we expect that the mcu has accepted
+	 * our command and is waiting for our new value
+	 * please note that maximum brightness is 255,
+	 * but due to physical layout it is equal to 0, so we simply
+	 * invert the value (MAX VALUE - NEW VALUE).
+	 */
+	if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
+		!= TXDUMMY) {
+		dev_err(&bd->dev, "set brightness failed\n");
+		ret = -ETIMEDOUT;
+	}
 
-		/*
-		 * If infact we get an TXDUMMY as output we are happy and dont
-		 * make any further comments about it
-		 */
+	/*
+	 * If infact we get an TXDUMMY as output we are happy and dont
+	 * make any further comments about it
+	 */
 out:
 	jornada_ssp_end();
 
-- 
2.29.2


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

* Re: [PATCH] backlight: journada720: fix Wmisleading-indentation warning
  2021-03-22 16:41 [PATCH] backlight: journada720: fix Wmisleading-indentation warning Arnd Bergmann
@ 2021-03-23  9:34 ` Daniel Thompson
  2021-03-23  9:43 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Thompson @ 2021-03-23  9:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lee Jones, Jingoo Han, Kristoffer Ericson, Richard Purdie,
	Arnd Bergmann, Sam Ravnborg, dri-devel, linux-fbdev,
	linux-kernel

On Mon, Mar 22, 2021 at 05:41:28PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> With gcc-11, we get a warning about code that looks correct
> but badly indented:
> 
> drivers/video/backlight/jornada720_bl.c: In function ‘jornada_bl_update_status’:
> drivers/video/backlight/jornada720_bl.c:66:11: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
>    66 |         } else  /* turn on backlight */
>       |           ^~~~
> 
> Change the formatting according to our normal conventions.
> 
> Fixes: 13a7b5dc0d17 ("backlight: Adds HP Jornada 700 series backlight driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

I'm dubious that the re-indent matches the original authors intent...
but it certainly does match what was actually written and tested so
on that basis:

Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Daniel.


 ---
>  drivers/video/backlight/jornada720_bl.c | 44 ++++++++++++-------------
>  1 file changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c
> index 996f7ba3b373..066d0dc98f60 100644
> --- a/drivers/video/backlight/jornada720_bl.c
> +++ b/drivers/video/backlight/jornada720_bl.c
> @@ -66,30 +66,30 @@ static int jornada_bl_update_status(struct backlight_device *bd)
>  	} else  /* turn on backlight */
>  		PPSR |= PPC_LDD1;
>  
> -		/* send command to our mcu */
> -		if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
> -			dev_info(&bd->dev, "failed to set brightness\n");
> -			ret = -ETIMEDOUT;
> -			goto out;
> -		}
> +	/* send command to our mcu */
> +	if (jornada_ssp_byte(SETBRIGHTNESS) != TXDUMMY) {
> +		dev_info(&bd->dev, "failed to set brightness\n");
> +		ret = -ETIMEDOUT;
> +		goto out;
> +	}
>  
> -		/*
> -		 * at this point we expect that the mcu has accepted
> -		 * our command and is waiting for our new value
> -		 * please note that maximum brightness is 255,
> -		 * but due to physical layout it is equal to 0, so we simply
> -		 * invert the value (MAX VALUE - NEW VALUE).
> -		 */
> -		if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
> -			!= TXDUMMY) {
> -			dev_err(&bd->dev, "set brightness failed\n");
> -			ret = -ETIMEDOUT;
> -		}
> +	/*
> +	 * at this point we expect that the mcu has accepted
> +	 * our command and is waiting for our new value
> +	 * please note that maximum brightness is 255,
> +	 * but due to physical layout it is equal to 0, so we simply
> +	 * invert the value (MAX VALUE - NEW VALUE).
> +	 */
> +	if (jornada_ssp_byte(BL_MAX_BRIGHT - bd->props.brightness)
> +		!= TXDUMMY) {
> +		dev_err(&bd->dev, "set brightness failed\n");
> +		ret = -ETIMEDOUT;
> +	}
>  
> -		/*
> -		 * If infact we get an TXDUMMY as output we are happy and dont
> -		 * make any further comments about it
> -		 */
> +	/*
> +	 * If infact we get an TXDUMMY as output we are happy and dont
> +	 * make any further comments about it
> +	 */
>  out:
>  	jornada_ssp_end();
>  
> -- 
> 2.29.2
> 

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

* Re: [PATCH] backlight: journada720: fix Wmisleading-indentation warning
  2021-03-22 16:41 [PATCH] backlight: journada720: fix Wmisleading-indentation warning Arnd Bergmann
  2021-03-23  9:34 ` Daniel Thompson
@ 2021-03-23  9:43 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2021-03-23  9:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Daniel Thompson, Jingoo Han, Kristoffer Ericson, Richard Purdie,
	Arnd Bergmann, Sam Ravnborg, dri-devel, linux-fbdev,
	linux-kernel

On Mon, 22 Mar 2021, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> With gcc-11, we get a warning about code that looks correct
> but badly indented:
> 
> drivers/video/backlight/jornada720_bl.c: In function ‘jornada_bl_update_status’:
> drivers/video/backlight/jornada720_bl.c:66:11: error: this ‘else’ clause does not guard... [-Werror=misleading-indentation]
>    66 |         } else  /* turn on backlight */
>       |           ^~~~
> 
> Change the formatting according to our normal conventions.
> 
> Fixes: 13a7b5dc0d17 ("backlight: Adds HP Jornada 700 series backlight driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/video/backlight/jornada720_bl.c | 44 ++++++++++++-------------
>  1 file changed, 22 insertions(+), 22 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2021-03-23  9:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 16:41 [PATCH] backlight: journada720: fix Wmisleading-indentation warning Arnd Bergmann
2021-03-23  9:34 ` Daniel Thompson
2021-03-23  9:43 ` Lee Jones

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