remoteproc: stm32: fix incorrect optional pointers
Subsystems (2)
PATCH 1/1 remoteproc: stm32: fix incorrect optional pointers
From: Arnd Bergmann <[email protected]>
Compile-testing without CONFIG_OF shows that the of_match_ptr() macro was used incorrectly here:
drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable]
As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with __maybe_unused annotations, so fix those as well by using the correct DEFINE_SIMPLE_DEV_PM_OPS() macros and removing the extraneous __maybe_unused modifiers. For completeness, also add a pm_ptr() to let the PM ops be eliminated completely when CONFIG_PM is turned off.
--- drivers/remoteproc/stm32_rproc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/remoteproc/stm32_rproc.c +6 -6
@@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev)rproc_free (rproc); } -static int __maybe_unused stm32_rproc_suspend (struct device *dev) +static int stm32_rproc_suspend (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;
@@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev)return 0 ; } -static int __maybe_unused stm32_rproc_resume (struct device *dev) +static int stm32_rproc_resume (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;
@@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, - stm32_rproc_suspend, stm32_rproc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, + stm32_rproc_suspend, stm32_rproc_resume);static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe, .remove_new = stm32_rproc_remove, .driver = { .name ="stm32-rproc" , - .pm = &stm32_rproc_pm_ops, - .of_match_table =of_match_ptr (stm32_rproc_match), + .pm =pm_ptr (&stm32_rproc_pm_ops), + .of_match_table = stm32_rproc_match, }, };module_platform_driver (stm32_rproc_driver);
Signature · 1 line
2.39.2
Hello Arnd,
Quoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Compile-testing without
CONFIG_OFshows that theof_match_ptr()macro was used incorrectly here:
drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable]As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated
SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with__maybe_unusedannotations, so fix those as well by using the correctDEFINE_SIMPLE_DEV_PM_OPS()macros and removing the extraneous__maybe_unusedmodifiers. For completeness, also add apm_ptr()to let the PM ops be eliminated completely whenCONFIG_PMis turned off.
Quoted 5 lines
Reported-by kernel test robot <[email protected]>Fixes 03bd158e1535e ("remoteproc: stm32: use correct format strings on 64-bit")Fixes 410119ee29b6c ("remoteproc: stm32: wakeup the system by wdg irq")Fixes 13140de09cc2d ("remoteproc: stm32: add an ST stm32_rproc driver")
The checkpatch complains here as you put 13 char instead of 12 for the sha1. I don't know if this can generate issue for scripts...
w or w/o the fix:
Thanks!
Arnaud
Quoted 38 lines
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/remoteproc/stm32_rproc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/remoteproc/stm32_rproc.c +4
-4@@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev)rproc_free (rproc); } -static int __maybe_unused stm32_rproc_suspend (struct device *dev) +static int stm32_rproc_suspend (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;@@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev)return 0 ; } -static int __maybe_unused stm32_rproc_resume (struct device *dev) +static int stm32_rproc_resume (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;@@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, - stm32_rproc_suspend, stm32_rproc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, + stm32_rproc_suspend, stm32_rproc_resume);static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe,
drivers/remoteproc/stm32_rproc.c static int __maybe_unused stm32_rproc_resume(struct device *dev) · line 958
Quoted 10 lines
drivers/remoteproc/stm32_rproc.c +2
-2.remove_new = stm32_rproc_remove, .driver = { .name = "stm32-rproc", - .pm = &stm32_rproc_pm_ops, - .of_match_table = of_match_ptr(stm32_rproc_match), + .pm = pm_ptr(&stm32_rproc_pm_ops), + .of_match_table = stm32_rproc_match, }, };module_platform_driver (stm32_rproc_driver);
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Mathieu Poirier
maintainerQuoted 21 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Compile-testing without
CONFIG_OFshows that theof_match_ptr()macro was used incorrectly here:
drivers/remoteproc/stm32_rproc.c:662:34: warning: unused variable 'stm32_rproc_match' [-Wunused-const-variable]As in almost every driver, the solution is simply to remove the use of this macro. The same thing happened with the deprecated
SIMPLE_DEV_PM_OPS(), but the corresponding warning was already shut up with__maybe_unusedannotations, so fix those as well by using the correctDEFINE_SIMPLE_DEV_PM_OPS()macros and removing the extraneous__maybe_unusedmodifiers. For completeness, also add apm_ptr()to let the PM ops be eliminated completely whenCONFIG_PMis turned off.Reported-by kernel test robot <[email protected]>Fixes 03bd158e1535e ("remoteproc: stm32: use correct format strings on 64-bit")Fixes 410119ee29b6c ("remoteproc: stm32: wakeup the system by wdg irq")Fixes 13140de09cc2d ("remoteproc: stm32: add an ST stm32_rproc driver")Signed-off-by Arnd Bergmann <[email protected]>
Quoted 4 lines
--- drivers/remoteproc/stm32_rproc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Fixed 13-character SHAs and applied.
Thanks,
Mathieu
Quoted 46 lines
drivers/remoteproc/stm32_rproc.c +6
-6@@ -921,7 +921,7 @@ static void stm32_rproc_remove(struct platform_device *pdev)rproc_free (rproc); } -static int __maybe_unused stm32_rproc_suspend (struct device *dev) +static int stm32_rproc_suspend (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;@@ -932,7 +932,7 @@ static int __maybe_unused stm32_rproc_suspend(struct device *dev)return 0 ; } -static int __maybe_unused stm32_rproc_resume (struct device *dev) +static int stm32_rproc_resume (struct device *dev) {struct rproc *rproc =dev_get_drvdata (dev);struct stm32_rproc *ddata = rproc->priv;@@ -943,16 +943,16 @@ static int __maybe_unused stm32_rproc_resume(struct device *dev)return 0 ; } -static SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, - stm32_rproc_suspend, stm32_rproc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_rproc_pm_ops, + stm32_rproc_suspend, stm32_rproc_resume);static struct platform_driver stm32_rproc_driver = { .probe = stm32_rproc_probe, .remove_new = stm32_rproc_remove, .driver = { .name ="stm32-rproc" , - .pm = &stm32_rproc_pm_ops, - .of_match_table =of_match_ptr (stm32_rproc_match), + .pm =pm_ptr (&stm32_rproc_pm_ops), + .of_match_table = stm32_rproc_match, }, };module_platform_driver (stm32_rproc_driver);Signature · 1 line
2.39.2