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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWdXNB=ijpWHWY5HgwJw8yw4jk9Bnmez-8MLzGRCQrXdg@mail.gmail.com>
Date: Mon, 27 Jan 2025 14:45:19 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Raphael Gallais-Pou <rgallaispou@...il.com>
Cc: Damien Le Moal <dlemoal@...nel.org>, Niklas Cassel <cassel@...nel.org>, 
	Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, 
	Pengutronix Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, 
	Matthias Brugger <matthias.bgg@...il.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
	Hans de Goede <hdegoede@...hat.com>, Patrice Chotard <patrice.chotard@...s.st.com>, 
	Chen-Yu Tsai <wens@...e.org>, Jernej Skrabec <jernej.skrabec@...il.com>, 
	Samuel Holland <samuel@...lland.org>, Viresh Kumar <vireshk@...nel.org>, 
	Geert Uytterhoeven <geert+renesas@...der.be>, linux-ide@...r.kernel.org, 
	linux-kernel@...r.kernel.org, imx@...ts.linux.dev, 
	linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org, 
	linux-sunxi@...ts.linux.dev, linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH RFC 14/14] ahci: sata_rcar: Switch from CONFIG_PM_SLEEP
 guards to pm_sleep_ptr()

Hi Raphael,

On Mon, 27 Jan 2025 at 13:46, Raphael Gallais-Pou <rgallaispou@...il.com> wrote:
> Letting the compiler remove these functions when the kernel is built
> without CONFIG_PM_SLEEP support is simpler and less error prone than the
> use of #ifdef based kernel configuration guards.
>
> Signed-off-by: Raphael Gallais-Pou <rgallaispou@...il.com>

Thanks for your patch!

The subsystem prefix is "ata", not "ahci" (not all ATA-drivers are
AHCI-drivers).

> --- a/drivers/ata/sata_rcar.c
> +++ b/drivers/ata/sata_rcar.c
> @@ -927,7 +927,6 @@ static void sata_rcar_remove(struct platform_device *pdev)
>         pm_runtime_disable(&pdev->dev);
>  }
>
> -#ifdef CONFIG_PM_SLEEP
>  static int sata_rcar_suspend(struct device *dev)
>  {
>         struct ata_host *host = dev_get_drvdata(dev);
> @@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops = {
>         .poweroff       = sata_rcar_suspend,
>         .restore        = sata_rcar_restore,
>  };
> -#endif

If CONFIG_PM_SLEEP is disabled (e.g. m68k allyesconfig):

    drivers/ata/sata_rcar.c: In function ‘sata_rcar_suspend’:
    drivers/ata/sata_rcar.c:936:9: error: implicit declaration of
function ‘ata_host_suspend’; did you mean ‘sata_rcar_suspend’?
[-Werror=implicit-function-declaration]
      936 |         ata_host_suspend(host, PMSG_SUSPEND);
          |         ^~~~~~~~~~~~~~~~
          |         sata_rcar_suspend
    drivers/ata/sata_rcar.c: In function ‘sata_rcar_resume’:
    drivers/ata/sata_rcar.c:973:9: error: implicit declaration of
function ‘ata_host_resume’; did you mean ‘sata_rcar_resume’?
[-Werror=implicit-function-declaration]
      973 |         ata_host_resume(host);
          |         ^~~~~~~~~~~~~~~
          |         sata_rcar_resume

>
>  static struct platform_driver sata_rcar_driver = {
>         .probe          = sata_rcar_probe,
> @@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver = {
>         .driver = {
>                 .name           = DRV_NAME,
>                 .of_match_table = sata_rcar_match,
> -#ifdef CONFIG_PM_SLEEP
> -               .pm             = &sata_rcar_pm_ops,
> -#endif
> +               .pm             = pm_sleep_ptr(&sata_rcar_pm_ops),
>         },
>  };

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ