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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfZUN0PVwveB9FM6QvyJicVE5WjCX3b5rfCGZOQs9hO8A@mail.gmail.com>
Date:   Tue, 12 Mar 2019 17:45:24 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Mans Rullgard <mans@...sr.com>
Cc:     Miguel Ojeda Sandonis <miguel.ojeda.sandonis@...il.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] auxdisplay: charlcd: make backlight initial state configurable

On Fri, Mar 1, 2019 at 9:14 PM Mans Rullgard <mans@...sr.com> wrote:
>
> The charlcd driver currently flashes the backlight once on init.
> This may not be desirable.  Thus, add options for turning the
> backlight off or on as well.
>
> Signed-off-by: Mans Rullgard <mans@...sr.com>
> ---
>  drivers/auxdisplay/Kconfig   | 21 +++++++++++++++++++++
>  drivers/auxdisplay/charlcd.c | 10 +++++++++-
>  2 files changed, 30 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig
> index 7d3fe27d6868..c52c738e554a 100644
> --- a/drivers/auxdisplay/Kconfig
> +++ b/drivers/auxdisplay/Kconfig
> @@ -445,6 +445,27 @@ config PANEL_BOOT_MESSAGE
>           An empty message will only clear the display at driver init time. Any other
>           printf()-formatted message is valid with newline and escape codes.
>
> +choice
> +       prompt "Backlight initial state"
> +       default CHARLCD_BL_FLASH

LGTM, but I don't agree on this default. I would prefer either on or
off, not flashing for sure.
Though it seems the case before the patch...

> +
> +       config CHARLCD_BL_OFF
> +               bool "Off"
> +               help
> +                 Backlight is initially turned off
> +
> +       config CHARLCD_BL_ON
> +               bool "On"
> +               help
> +                 Backlight is initially turned on
> +
> +       config CHARLCD_BL_FLASH
> +               bool "Flash"
> +               help
> +                 Backlight is flashed briefly on init
> +
> +endchoice
> +
>  endif # AUXDISPLAY
>
>  config PANEL
> diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
> index db0356dca2d7..ff8c53c082ff 100644
> --- a/drivers/auxdisplay/charlcd.c
> +++ b/drivers/auxdisplay/charlcd.c
> @@ -769,6 +769,14 @@ static void charlcd_puts(struct charlcd *lcd, const char *s)
>  #define LCD_INIT_TEXT "Linux-" UTS_RELEASE "\n"
>  #endif
>
> +#ifdef CONFIG_CHARLCD_BL_ON
> +#define LCD_INIT_BL "\x1b[L+"
> +#elif defined (CONFIG_CHARLCD_BL_FLASH)
> +#define LCD_INIT_BL "\x1b[L*"

> +#else

I would rather put here defined(_OFF)...

> +#define LCD_INIT_BL "\x1b[L-"

...and do

#else
#define LCD_INIT_BL "" // or whatever stands for as-is

> +#endif
> +
>  /* initialize the LCD driver */
>  static int charlcd_init(struct charlcd *lcd)
>  {
> @@ -790,7 +798,7 @@ static int charlcd_init(struct charlcd *lcd)
>                 return ret;
>
>         /* display a short message */
> -       charlcd_puts(lcd, "\x1b[Lc\x1b[Lb\x1b[L*" LCD_INIT_TEXT);
> +       charlcd_puts(lcd, "\x1b[Lc\x1b[Lb" LCD_INIT_BL LCD_INIT_TEXT);
>
>         /* clear the display on the next device opening */
>         priv->must_clear = true;
> --
> 2.20.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ