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] [thread-next>] [day] [month] [year] [list]
Date: Mon, 6 May 2024 13:44:26 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>, Kent Gibson <warthog618@...il.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org, Bartosz Golaszewski <brgl@...ev.pl>, 
	Marek Behún <kabel@...nel.org>
Subject: Re: [PATCH v1 1/1] gpiolib: Discourage to use formatting strings in
 line names

On Mon, May 6, 2024 at 1:39 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Mon, May 6, 2024 at 10:19 AM Linus Walleij <linus.walleij@...aro.org> wrote:
> > On Sun, May 5, 2024 at 4:14 PM Andy Shevchenko
> > <andy.shevchenko@...il.com> wrote:
> >
> > > Currently the documentation for line names allows to use %u inside
> > > the alternative name. This is broken in character device approach
> > > from day 1 and being in use solely in sysfs.
> > >
> > > Character device interface has a line number as a part of its address,
> > > so the users better rely on it. Hence remove the misleading documentation.
> > >
> > > On top of that, there are no in-kernel users (out of 6, if I'm correct)
> > > for such names and moreover if one exists it won't help in distinguishing
> > > lines with the same naming as '%u' will also be in them and we will get
> > > a warning in gpiochip_set_desc_names() for such cases.

Dunno if I need to elaborate this more, but just in case here is one:
Even if one puts '%u' to one line and avoids putting it into other:

 "gpio%u.foo"
 "gpioX.foo"

it means that it was already in mind to distinguish them beforehand,
diminishing the '%u' appearance in the first place. I.e. one may do

 "foo X"
 "foo Y"

to begin with. Besides that repetitive namings are discouraged and
most likely have no value but confusion.
For example,

"gpio%u.SPI CS"
"gpio%u.SPI CS"

would be rather

"SPI CS 0"
"SPI CS 1"

which is much more clearer to the user.

> > > Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
> >
> > Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
>
> Thank you!
>
> Meanwhile, Cc'ing to Kent as well.
>
> --
> With Best Regards,
> Andy Shevchenko



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ