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] [day] [month] [year] [list]
Message-ID:
 <AS4PR04MB9692F9CB0AF6B7ED1D2F37F1E72F2@AS4PR04MB9692.eurprd04.prod.outlook.com>
Date: Tue, 26 Nov 2024 13:47:23 +0000
From: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>
To: Fabio Estevam <festevam@...il.com>, "luiz.dentz@...il.com"
	<luiz.dentz@...il.com>
CC: Amitkumar Karwar <amitkumar.karwar@....com>, "marcel@...tmann.org"
	<marcel@...tmann.org>, "linux-bluetooth@...r.kernel.org"
	<linux-bluetooth@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, Fabio Estevam <festevam@...x.de>, Sherry Sun
	<sherry.sun@....com>, Luke Wang <ziniu.wang_1@....com>
Subject: [PATCH] Bluetooth: btnxpuart: Switch to SYSTEM_SLEEP_PM_OPS

Hi Fabio,

Thank you for the patch and the improvement it brings along.

Reviewed-by: Neeraj Sanjay Kale <neeraj.sanjaykale@....com>

Thanks,
Neeraj
 
> 
> From: Fabio Estevam <festevam@...x.de>
> 
> Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern
> SYSTEM_SLEEP_PM_OPS() alternative.
> 
> The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
> the compiler to evaluate if the suspend/resume() functions are used at build
> time or are simply dead code.
> 
> This allows removing the CONFIG_PM_SLEEP ifdefery from the
> suspend/resume() functions.
> 
> Signed-off-by: Fabio Estevam <festevam@...x.de>
> ---
>  drivers/bluetooth/btnxpuart.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/bluetooth/btnxpuart.c b/drivers/bluetooth/btnxpuart.c
> index 569f5b7d6e46..06c1093c70ab 100644
> --- a/drivers/bluetooth/btnxpuart.c
> +++ b/drivers/bluetooth/btnxpuart.c
> @@ -1588,7 +1588,6 @@ static void nxp_serdev_remove(struct
> serdev_device *serdev)
>         hci_free_dev(hdev);
>  }
> 
> -#ifdef CONFIG_PM_SLEEP
>  static int nxp_serdev_suspend(struct device *dev)  {
>         struct btnxpuart_dev *nxpdev = dev_get_drvdata(dev); @@ -1606,7
> +1605,6 @@ static int nxp_serdev_resume(struct device *dev)
>         ps_control(psdata->hdev, PS_STATE_AWAKE);
>         return 0;
>  }
> -#endif
> 
>  static struct btnxpuart_data w8987_data __maybe_unused = {
>         .helper_fw_name = NULL,
> @@ -1628,7 +1626,7 @@ static const struct of_device_id
> nxpuart_of_match_table[] __maybe_unused = {  MODULE_DEVICE_TABLE(of,
> nxpuart_of_match_table);
> 
>  static const struct dev_pm_ops nxp_pm_ops = {
> -       SET_SYSTEM_SLEEP_PM_OPS(nxp_serdev_suspend,
> nxp_serdev_resume)
> +       SYSTEM_SLEEP_PM_OPS(nxp_serdev_suspend, nxp_serdev_resume)
>  };
> 
>  static struct serdev_device_driver nxp_serdev_driver = { @@ -1637,7 +1635,7
> @@ static struct serdev_device_driver nxp_serdev_driver = {
>         .driver = {
>                 .name = "btnxpuart",
>                 .of_match_table = of_match_ptr(nxpuart_of_match_table),
> -               .pm = &nxp_pm_ops,
> +               .pm = pm_sleep_ptr(&nxp_pm_ops),
>         },
>  };
> 
> --
> 2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ