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:   Wed, 15 Mar 2023 10:44:24 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v1 3/3] gpiolib: Move gpiodevice_*() to gpiodev namespace

On Fri, Mar 10, 2023 at 6:01 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Fri, Mar 10, 2023 at 05:48:39PM +0100, Bartosz Golaszewski wrote:
> > On Thu, Mar 9, 2023 at 7:52 PM Andy Shevchenko
> > <andriy.shevchenko@...ux.intel.com> wrote:
> > > On Wed, Mar 08, 2023 at 11:49:53AM +0100, Bartosz Golaszewski wrote:
> > > > On Tue, Mar 7, 2023 at 7:25 PM Andy Shevchenko
> > > > <andriy.shevchenko@...ux.intel.com> wrote:
> > > > >
> > > > > The functions that operates on the same device object would
> > > > > have the same namespace for better code understanding and
> > > > > maintenance.
>
> ...
>
> > > > > -static void gpiodevice_release(struct device *dev)
> > > > > +static void gpiodev_release(struct device *dev)
> > > > >  {
> > > > >         struct gpio_device *gdev = to_gpio_device(dev);
> > > > >         unsigned long flags;
> > > > > @@ -617,7 +617,7 @@ static int gpiochip_setup_dev(struct gpio_device *gdev)
> > > > >                 return ret;
> > > > >
> > > > >         /* From this point, the .release() function cleans up gpio_device */
> > > > > -       gdev->dev.release = gpiodevice_release;
> > > > > +       gdev->dev.release = gpiodev_release;
> > > > >
> > > > >         ret = gpiochip_sysfs_register(gdev);
> > > > >         if (ret)
> > >
> > > > But the only other function that's in the gpiodev_ namespace operates
> > > > on struct gpio_device so that change doesn't make much sense to me.
> > >
> > > I'm not sure I understood the comment.
> > > After this change we will have
> > >
> > > static int gpiodev_add_to_list(struct gpio_device *gdev)
> > > static void gpiodev_release(struct device *dev)
> > >
> >
> > Do you want to use the same prefix for both because struct device in
> > the latter is embedded in struct gpio_device in the former?
>
> Yes, the logic to have logically grouped namespace for these APIs.
> Meaning on what they are taking as an effective object to proceed
> with.
>

I don't have a better idea so applied it.

Bart

> > > There are also gpio_device_*() I have noticed, so may be these should be
> > > actually in that namespace?
> > >
> > > And we have
> > >
> > > static int gpiochip_setup_dev(struct gpio_device *gdev)
> > > static void gpiolib_dbg_show(struct seq_file *s, struct gpio_device *gdev)
> > >
> > > That said, what do you think is the best to make this more consistent?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ