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]
Date:   Tue, 18 Apr 2023 10:30:57 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Dong Aisheng <aisheng.dong@....com>,
        Guoniu Zhou <guoniu.zhou@....com>,
        Stefan Riedmueller <s.riedmueller@...tec.de>,
        Arnd Bergmann <arnd@...db.de>,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        NXP Linux Team <linux-imx@....com>,
        Christian Hemp <c.hemp@...tec.de>,
        Jacopo Mondi <jacopo@...ndi.org>, linux-media@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: nxp: ignore unused suspend operations

Hi Arnd,

Thank you for the patch.

On Tue, Apr 18, 2023 at 09:15:51AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> gcc warns about some functions being unused when CONFIG_PM is
> disabled:
> 
> drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:328:12: error: 'mxc_isi_pm_resume' defined but not used [-Werror=unused-function]
>   328 | static int mxc_isi_pm_resume(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~
> drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c:314:12: error: 'mxc_isi_pm_suspend' defined but not used [-Werror=unused-function]
>   314 | static int mxc_isi_pm_suspend(struct device *dev)
>       |            ^~~~~~~~~~~~~~~~~~
> 
> Use the modern SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() helpers in place
> of the old SET_SYSTEM_SLEEP_PM_OPS()/SET_RUNTIME_PM_OPS() ones, and add
> a pm_ptr() check to ensure they get dropped by the compiler.

I've also sent a patch for this one :-) See
https://lore.kernel.org/linux-media/20230417053949.7395-2-laurent.pinchart@ideasonboard.com/T/#u.

Your patch looks better, so

Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

> Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> index 238521622b75..253e77189b69 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c
> @@ -378,8 +378,8 @@ static int mxc_isi_runtime_resume(struct device *dev)
>  }
>  
>  static const struct dev_pm_ops mxc_isi_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
> -	SET_RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
> +	SYSTEM_SLEEP_PM_OPS(mxc_isi_pm_suspend, mxc_isi_pm_resume)
> +	RUNTIME_PM_OPS(mxc_isi_runtime_suspend, mxc_isi_runtime_resume, NULL)
>  };
>  
>  /* -----------------------------------------------------------------------------
> @@ -528,7 +528,7 @@ static struct platform_driver mxc_isi_driver = {
>  	.driver = {
>  		.of_match_table = mxc_isi_of_match,
>  		.name		= MXC_ISI_DRIVER_NAME,
> -		.pm		= &mxc_isi_pm_ops,
> +		.pm		= pm_ptr(&mxc_isi_pm_ops),
>  	}
>  };
>  module_platform_driver(mxc_isi_driver);

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ