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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOiHx==ttP2T=VLsSE9nLr5Cai_D+Khr6ePJVdOEim8ThWSdmA@mail.gmail.com>
Date: Mon, 24 Nov 2025 13:40:01 +0100
From: Jonas Gorski <jonas.gorski@...il.com>
To: Jisheng Zhang <jszhang@...nel.org>
Cc: Doug Berger <opendmb@...il.com>, Florian Fainelli <florian.fainelli@...adcom.com>, 
	bcm-kernel-feedback-list@...adcom.com, 
	Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>, 
	Hoan Tran <hoan@...amperecomputing.com>, Andy Shevchenko <andy@...nel.org>, 
	Daniel Palmer <daniel@...ngy.jp>, Romain Perier <romain.perier@...il.com>, 
	Grygorii Strashko <grygorii.strashko@...com>, Santosh Shilimkar <ssantosh@...nel.org>, 
	Kevin Hilman <khilman@...nel.org>, Robert Jarzmik <robert.jarzmik@...e.fr>, 
	Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Shubhrajyoti Datta <shubhrajyoti.datta@....com>, Srinivas Neeli <srinivas.neeli@....com>, 
	Michal Simek <michal.simek@....com>, linux-gpio@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	linux-omap@...r.kernel.org
Subject: Re: [PATCH v5 02/14] gpio: brcmstb: Use modern PM macros

Hi,

On Mon, Nov 24, 2025 at 1:39 AM Jisheng Zhang <jszhang@...nel.org> wrote:
>
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
> Acked-by: Doug Berger <opendmb@...il.com>
> Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
> ---
>  drivers/gpio/gpio-brcmstb.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
> index f40c9472588b..af9287ff5dc4 100644
> --- a/drivers/gpio/gpio-brcmstb.c
> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -533,7 +533,6 @@ static void brcmstb_gpio_shutdown(struct platform_device *pdev)
>         brcmstb_gpio_quiesce(&pdev->dev, false);
>  }
>
> -#ifdef CONFIG_PM_SLEEP
>  static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv,
>                                       struct brcmstb_gpio_bank *bank)
>  {
> @@ -572,14 +571,9 @@ static int brcmstb_gpio_resume(struct device *dev)
>         return 0;
>  }
>
> -#else
> -#define brcmstb_gpio_suspend   NULL
> -#define brcmstb_gpio_resume    NULL
> -#endif /* CONFIG_PM_SLEEP */
> -
>  static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
> -       .suspend_noirq  = brcmstb_gpio_suspend,
> -       .resume_noirq = brcmstb_gpio_resume,
> +       .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend),
> +       .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
>  };
>
>  static int brcmstb_gpio_probe(struct platform_device *pdev)
> @@ -755,7 +749,7 @@ static struct platform_driver brcmstb_gpio_driver = {
>         .driver = {
>                 .name = "brcmstb-gpio",
>                 .of_match_table = brcmstb_gpio_of_match,
> -               .pm = &brcmstb_gpio_pm_ops,
> +               .pm = pm_sleep_ptr(&brcmstb_gpio_pm_ops),

won't this cause a "brcmstb_gpio_pm_ops is unused" compile warning for
!CONFIG_PM_SLEEP?

You probably need to add a __maybe_unused to brcmstb_gpio_pm_ops
(which incidentally DEFINE_NOIRQ_DEV_PM_OPS() also doesn't set, but
all other *_DEV_PM_OPS() macros do).

Best regards,
Jonas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ