lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 23 Sep 2018 19:12:28 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Miguel Ojeda Sandonis <miguel.ojeda.sandonis@...il.com>
Cc:     benmoore422@...il.com, Jiri Kosina <trivial@...nel.org>,
        Willy Tarreau <willy@...roxy.com>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drivers/auxdisplay: TRIVIAl removed unnessecary braces
 from if statements

Hi Ben,

On Sun, Sep 23, 2018 at 5:33 PM Miguel Ojeda
<miguel.ojeda.sandonis@...il.com> wrote:
> On Sun, Sep 23, 2018 at 4:33 PM,  <benmoore422@...il.com> wrote:
> > From: Ben Moore <benmoore422@...il.com>
> >
> > removed braches from single line if statements
> >
> > Signed-off-by: Ben Moore <benmoore422@...il.com>

Thanks for you patch!

> > --- 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 */
> > @@ -1025,9 +1024,8 @@ static void lcd_init(void)
> >                         lcd.pins.rs = DEFAULT_LCD_PIN_RS;
> >                 if (lcd.pins.rw == PIN_NOT_SET)
> >                         lcd.pins.rw = DEFAULT_LCD_PIN_RW;
> > -       } else {
> > +       } else
> >                 charlcd->ops = &charlcd_tilcd_ops;
> > -       }

Please keep braces for single-statement branches if the other branch needs
the braces.

I think running scripts/checkpatch.pl on your patch would tell you about that
rule.

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ