linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [PATCHv2 TRIVIAL] auxdisplay: remove unnecessary braces
@ 2018-09-23 17:25 benmoore422
  2018-10-06 20:59 ` Miguel Ojeda
  0 siblings, 1 reply; 2+ messages in thread
From: benmoore422 @ 2018-09-23 17:25 UTC (permalink / raw)
  To: w, miguel.ojeda.sandonis, geert+renesas; +Cc: linux-kernel, benmoore422

From: Ben Moore <benmoore422@gmail.com>

I have removed some unnecessary braces from if statements.
As well as inspecting the other driverfiles for similar
style issues.

Signed-off-by: Ben Moore <benmoore422@gmail.com>
---
 drivers/auxdisplay/ht16k33.c | 4 ++--
 drivers/auxdisplay/panel.c   | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index a43276c76fc6..854bb2b90368 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -479,9 +479,9 @@ static int ht16k33_probe(struct i2c_client *client,

 	err = of_property_read_u32(node, "default-brightness-level",
 				   &dft_brightness);
-	if (err) {
+	if (err)
 		dft_brightness = MAX_BRIGHTNESS;
-	} else if (dft_brightness > MAX_BRIGHTNESS) {
+	else if (dft_brightness > MAX_BRIGHTNESS) {
 		dev_warn(&client->dev,
 			 "invalid default brightness level: %u, using %u\n",
 			 dft_brightness, MAX_BRIGHTNESS);
diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c
index 3b25a643058c..f769431fbb52 100644
--- a/drivers/auxdisplay/panel.c
+++ b/drivers/auxdisplay/panel.c
@@ -695,11 +695,10 @@ static void lcd_send_serial(int byte)
 	for (bit = 0; bit < 8; bit++) {
 		clear_bit(LCD_BIT_CL, bits);	/* CLK low */
 		panel_set_bits();
-		if (byte & 1) {
+		if (byte & 1)
 			set_bit(LCD_BIT_DA, bits);
-		} else {
+		else
 			clear_bit(LCD_BIT_DA, bits);
-		}

 		panel_set_bits();
 		udelay(2);  /* maintain the data during 2 us before CLK up */
--
2.11.0


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

* Re: [PATCH] [PATCHv2 TRIVIAL] auxdisplay: remove unnecessary braces
  2018-09-23 17:25 [PATCH] [PATCHv2 TRIVIAL] auxdisplay: remove unnecessary braces benmoore422
@ 2018-10-06 20:59 ` Miguel Ojeda
  0 siblings, 0 replies; 2+ messages in thread
From: Miguel Ojeda @ 2018-10-06 20:59 UTC (permalink / raw)
  To: Ben Moore; +Cc: Willy Tarreau, Geert Uytterhoeven, linux-kernel

Hi Ben,

On Sun, Sep 23, 2018 at 7:26 PM <benmoore422@gmail.com> wrote:
> I have removed some unnecessary braces from if statements.
> As well as inspecting the other driverfiles for similar
> style issues.

Thanks for the new version!

> -       if (err) {
> +       if (err)
>                 dft_brightness = MAX_BRIGHTNESS;
> -       } else if (dft_brightness > MAX_BRIGHTNESS) {
> +       else if (dft_brightness > MAX_BRIGHTNESS) {

This one breaks the braces-if-the-other-branch-has-them that Geert
told you about:

  https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces

> -               if (byte & 1) {
> +               if (byte & 1)
>                         set_bit(LCD_BIT_DA, bits);
> -               } else {
> +               else
>                         clear_bit(LCD_BIT_DA, bits);
> -               }

This one seems fine.

Cheers,
Miguel

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

end of thread, other threads:[~2018-10-06 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-23 17:25 [PATCH] [PATCHv2 TRIVIAL] auxdisplay: remove unnecessary braces benmoore422
2018-10-06 20:59 ` Miguel Ojeda

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