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:   Thu, 26 Jan 2023 15:46:23 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     linux-gpio@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        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 02:27:56PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> The asm-generic/gpio.h file is now always included when
> using gpiolib, so just move its contents into linux/gpio.h
> with a few minor simplifications.

Thanks! Very appreciated, my comments below.

...

> --- 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.

>  #include <linux/errno.h>
>  #include <linux/kernel.h>
>  #include <linux/clk.h>
> @@ -24,8 +25,6 @@
>  #include <linux/spinlock.h>
>  #include <linux/pm_runtime.h>
>  
> -#include <asm-generic/gpio.h>
> -
>  #define MAX_REGS_BANKS 5
>  #define MAX_INT_PER_BANK 32

Thanks for this, that was a PITA!

...

> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -30,7 +30,7 @@
>  
>  #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"

...

> --- 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>

...

> +/*
> + * "valid" GPIO numbers are nonnegative and may be passed to
> + * setup routines like gpio_request().  only some valid numbers

While at it, '.  only' --> '. Only'.

> + * 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);

Ditto.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ