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:   Thu, 6 May 2021 12:33:00 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     Joe Perches <joe@...ches.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 34/35] tty: make tty_get_byte_size available

On Thu, May 6, 2021 at 11:31 AM Jiri Slaby <jirislaby@...nel.org> wrote:
>
> On 06. 05. 21, 10:24, Andy Shevchenko wrote:
> > if (!account_flags)
> >    return bits;
> >
> > ?
>
> So I have:


Good to me, feel free to add
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
to this variant.

> unsigned char tty_get_byte_size(unsigned int cflag, bool account_flags)
> {
>          unsigned char bits;
>
>          switch (cflag & CSIZE) {
>          case CS5:
>                  bits = 5;
>                  break;
>          case CS6:
>                  bits = 6;
>                  break;
>          case CS7:
>                  bits = 7;
>                  break;
>          case CS8:
>          default:
>                  bits = 8;
>                  break;
>          }
>
>          if (!account_flags)
>                  return bits;
>
>          if (cflag & CSTOPB)
>                  bits++;
>          if (cflag & PARENB)
>                  bits++;
>
>          return bits + 2;
> }
>
> thanks,
> --
> js
> suse labs



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ