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: <CACRpkdZ49_mo0AN78ri4WTt+V2gNdFOTgxzgfXw+3vd2rNNiJw@mail.gmail.com>
Date: Wed, 24 Sep 2025 12:25:29 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Wei <wei.liu@....qualcomm.com>
Cc: dmitry.torokhov@...il.com, linux-input@...r.kernel.org, 
	linux-kernel@...r.kernel.org, gatien.chevallier@...s.st.com, 
	namcao@...utronix.de, zhiqiang.tu@....qualcomm.com
Subject: Re: [PATCH] Input: gpio-keys - fix misleading GPIO number

On Wed, Sep 24, 2025 at 8:49 AM Wei <wei.liu@....qualcomm.com> wrote:

> From: Wei Liu <wei.liu@....qualcomm.com>
>
> The error log prints button->gpio, which is unset and default to 0
> in non-legacy configurations, leading to misleading messages.
>
> Use desc_to_gpio() to report the actual global GPIO number.
>
> Signed-off-by: Wei Liu <wei.liu@....qualcomm.com>
> ---
>  drivers/input/keyboard/gpio_keys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index f9db86da0818..243295a3ea1d 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -584,7 +584,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
>                                 error = irq;
>                                 dev_err_probe(dev, error,
>                                               "Unable to get irq number for GPIO %d\n",
> -                                             button->gpio);
> +                                             desc_to_gpio(bdata->gpiod));

That's technically a legacy interface.

Can we just not mention the GPIO number?

The only thing that would actually make sense in this kind
of errors is if we add some new interface like:

const char * get_gpiod_debug_string(gpiod);

that can output the chip and line number from the core.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ