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: <Z5eirJJp/cZzzGPd@lizhi-Precision-Tower-5810>
Date: Mon, 27 Jan 2025 10:13:48 -0500
From: Frank Li <Frank.li@....com>
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 05/14] ahci: imx: Switch from CONFIG_PM_SLEEP guards
 to pm_sleep_ptr()

On Mon, Jan 27, 2025 at 01:46:00PM +0100, Raphael Gallais-Pou 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>

Reviewed-by: Frank Li <Frank.Li@....com>

> ---
>  drivers/ata/ahci_imx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
> index f01f08048f97aa230877e413ba6e416d79779c1b..ec75a16c630a79ce10ea98b16c44c9a3908f869f 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -993,7 +993,6 @@ static void ahci_imx_host_stop(struct ata_host *host)
>  	clk_disable_unprepare(imxpriv->sata_clk);
>  }
>
> -#ifdef CONFIG_PM_SLEEP
>  static int imx_ahci_suspend(struct device *dev)
>  {
>  	struct ata_host *host = dev_get_drvdata(dev);
> @@ -1021,9 +1020,8 @@ static int imx_ahci_resume(struct device *dev)
>
>  	return ahci_platform_resume_host(dev);
>  }
> -#endif
>
> -static SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume);
>
>  static struct platform_driver imx_ahci_driver = {
>  	.probe = imx_ahci_probe,
> @@ -1031,7 +1029,7 @@ static struct platform_driver imx_ahci_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
>  		.of_match_table = imx_ahci_of_match,
> -		.pm = &ahci_imx_pm_ops,
> +		.pm = pm_sleep_ptr(&ahci_imx_pm_ops),
>  	},
>  };
>  module_platform_driver(imx_ahci_driver);
>
> --
> 2.48.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ