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]
Message-ID: <CAHp75Vdh6ngva4CgWY8bfQXJMjoFYDHOx0Q7c+9wOD1eebb8qA@mail.gmail.com>
Date:   Thu, 28 May 2020 16:43:01 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Michael Walle <michael@...le.cc>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Mark Brown <broonie@...nel.org>,
        Pierre-Louis Bossart <pierre-louis.bossart@...el.com>
Subject: Re: [PATCH v5 2/2] gpio: add a reusable generic gpio_chip using regmap

On Thu, May 28, 2020 at 4:00 PM Michael Walle <michael@...le.cc> wrote:
> Am 2020-05-28 13:45, schrieb Andy Shevchenko:
> > On Thu, May 28, 2020 at 7:04 AM Michael Walle <michael@...le.cc> wrote:

> > More comments from me below.
>
> Thanks for the review.

You are welcome! Thanks for doing this actually.

(So, the not commented points I think you agreed with)

...

> >>  # Device drivers. Generally keep list sorted alphabetically
> >
> > Hmm...
> >
> >> +obj-$(CONFIG_GPIO_REGMAP)      += gpio-regmap.o
> >>  obj-$(CONFIG_GPIO_GENERIC)     += gpio-generic.o
> >
> > ...is it?
>
> That's because gpio-regmap.o seems not be a driver and more of a generic
> thing (like gpio-generic.o) and gpio-generic.o has another rule two
> lines
> below and I don't want to put gpio-regmap.o in between.

OK!

...

> >> +       if (gpio->reg_dir_out_base) {
> >> +               base = gpio_regmap_addr(gpio->reg_dir_out_base);
> >> +               invert = 0;
> >> +       } else if (gpio->reg_dir_in_base) {
> >> +               base = gpio_regmap_addr(gpio->reg_dir_in_base);
> >> +               invert = 1;
> >> +       } else {
> >
> >> +               return GPIO_LINE_DIRECTION_IN;
> >
> > Hmm... Doesn't it an erroneous case and we basically shouldn't be here?
>
> yeah, I'll return -EOPNOTSUPP. Better than just ignoring, right?

Yes, that's what I meant.

...

> >> +       if (!!(val & mask) ^ invert)
> >> +               return GPIO_LINE_DIRECTION_OUT;
> >
> >> +       else
> >
> > Redundant 'else'.
>
> IMHO, That looks really strange. like it has nothing to do with the
> if statement. I'd like to keep that one.

We have many drivers done like that, but it's minor, so, up to you and
maintainers.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ