media: nxp: ignore unused suspend operations
Subsystems (3)
PATCH 1/1 media: nxp: ignore unused suspend operations
From: Arnd Bergmann <[email protected]>
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.
--- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +3 -3
@@ -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);
Signature · 1 line
2.39.2
Hi Arnd,
Thank you for the patch.
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis 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 intmxc_isi_pm_resume(struct device *dev)
Quoted 8 lines
| ^~~~~~~~~~~~~~~~~ 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/[email protected]/T/#u.
Your patch looks better, so
Quoted 30 lines
Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +3
-3@@ -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);
Signature · 3 lines
Regards, Laurent Pinchart
Hi Arnd,
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis disabled:
???
The Kconfig has a:
depends on HAS_DMA && PM
So how can this be compiled with CONFIG_PM not set?
Am I missing something?
Hans
Quoted 34 lines
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 intmxc_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.Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +2
-2@@ -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 ) };/* -----------------------------------------------------------------------------
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c static struct platform_driver mxc_isi_driver = { · line 534
Quoted 8 lines
drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +1
-1@@ -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);
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 8 lines · Hans Verkuil
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis disabled:???
Quoted 7 lines
The
Kconfighas a:depends on HAS_DMA && PMSo how can this be compiled with
CONFIG_PMnot set?Am I missing something?
My mistake, the warning only shows up when CONFIG_PM_SLEEP is disabled.
Arnd
Laurent Pinchart
maintainerQuoted 10 lines · Hans Verkuil
Hi Arnd,
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis disabled:???
Quoted 7 lines
The
Kconfighas a:depends on HAS_DMA && PMSo how can this be compiled with
CONFIG_PMnot set?Am I missing something?
The warning appears when CONFIG_PM_SLEEP is disabled. The pm_ptr() change is thus not useful, but the switch to SYSTEM_SLEEP_PM_OPS() and RUNTIME_PM_OPS() make a difference.
Quoted 41 lines
Quoted 41 lines
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 intmxc_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.Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +3
-3@@ -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);
Signature · 3 lines
Regards, Laurent Pinchart
Hi Arnd,
Quoted 15 lines · Laurent Pinchart
Quoted 14 lines · Hans Verkuil
Hi Arnd,
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis disabled:???
The
Kconfighas a:depends on HAS_DMA && PM
Quoted 7 lines
Quoted 3 lines
So how can this be compiled with
CONFIG_PMnot set?Am I missing something?
The warning appears when
CONFIG_PM_SLEEPis disabled. Thepm_ptr()change is thus not useful, but the switch toSYSTEM_SLEEP_PM_OPS()andRUNTIME_PM_OPS()make a difference.
Can you post a v3?
Thank you!
Hans
Quoted 43 lines
Quoted 42 lines
Quoted 42 lines
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 intmxc_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.Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")Signed-off-by Arnd Bergmann <[email protected]>--- drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c +3
-3@@ -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);
Quoted 15 lines · Laurent Pinchart
Quoted 14 lines · Hans Verkuil
Hi Arnd,
Quoted 4 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
gcc warns about some functions being unused when
CONFIG_PMis disabled:???
The
Kconfighas a:depends on HAS_DMA && PM
Quoted 7 lines
Quoted 3 lines
So how can this be compiled with
CONFIG_PMnot set?Am I missing something?
The warning appears when
CONFIG_PM_SLEEPis disabled. Thepm_ptr()change is thus not useful, but the switch toSYSTEM_SLEEP_PM_OPS()andRUNTIME_PM_OPS()make a difference.
I sent a v3 now. I ended up leaving the pm_ptr() in here, based on the recommended usage of the new macros.
Arnd