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]
Message-Id: <a717fec9-db2b-47fb-813d-e734e26e51c0@app.fastmail.com>
Date:   Thu, 26 Jan 2023 16:43:35 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Andy Shevchenko" <andriy.shevchenko@...ux.intel.com>,
        "Arnd Bergmann" <arnd@...nel.org>
Cc:     "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        "Bartosz Golaszewski" <bartosz.golaszewski@...aro.org>,
        "Christophe Leroy" <christophe.leroy@...roup.eu>,
        "Dmitry Torokhov" <dmitry.torokhov@...il.com>,
        "Linus Walleij" <linus.walleij@...aro.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/8] gpiolib: remove asm-generic/gpio.h

On Thu, Jan 26, 2023, at 14:46, Andy Shevchenko wrote:
> On Thu, Jan 26, 2023 at 02:27:56PM +0100, Arnd Bergmann wrote:

>> --- a/drivers/gpio/gpio-davinci.c
>> +++ b/drivers/gpio/gpio-davinci.c
>> @@ -7,6 +7,7 @@
>>   */
>
>>  #include <linux/gpio/driver.h>
>
>
>> +#include <linux/gpio.h>
>
> I believe the driver does not need this.
>
> I have briefly checked all gpio_ places in it and found nothing that requires
> this inclusion to be done.

ok
  
>>  #ifdef CONFIG_GPIOLIB
>>  #include "../gpio/gpiolib.h"
>> -#include <asm-generic/gpio.h>
>> +#include <linux/gpio.h>
>
> Can we actually swap them?
>
> #include <linux/gpio.h>
> #include "../gpio/gpiolib.h"
>
> But hold on, why do we even need gpio.h here?!
>
>>  #endif
>>  
>>  #include "core.h"
>
> ...

I probably did all the above in response to build regressions,
but I'll try to change them based on your suggestion and see
what happens.

>> --- a/include/linux/gpio.h
>> +++ b/include/linux/gpio.h
>> @@ -54,26 +54,101 @@ struct gpio {
>>  };
>>  
>>  #ifdef CONFIG_GPIOLIB
>> -#include <asm-generic/gpio.h>
>> +#include <linux/compiler.h>
>
>> +#include <linux/gpio/driver.h>
>> +#include <linux/gpio/consumer.h>
>
> #include <linux/gpio/consumer.h>
> #include <linux/gpio/driver.h>
>

Done

>> +/*
>> + * "valid" GPIO numbers are nonnegative and may be passed to
>> + * setup routines like gpio_request().  only some valid numbers
>
> While at it, '.  only' --> '. Only'.

Done

>> + * can successfully be requested and used.
>> + *
>> + * Invalid GPIO numbers are useful for indicating no-such-GPIO in
>> + * platform data and other tables.
>> + */
>
> ...
>
>> +extern int gpio_request(unsigned gpio, const char *label);
>> +extern void gpio_free(unsigned gpio);
>
> While at it, s/extern//.

>> +extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
>> +extern int gpio_request_array(const struct gpio *array, size_t num);
>> +extern void gpio_free_array(const struct gpio *array, size_t num);

Done

Thanks for the review,

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ