media: marvell-ccic: Fix -Wunused-function warnings
PATCH 1/1 media: marvell-ccic: Fix -Wunused-function warnings
If CONFIG_PM is n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
static int mmpcam_resume(struct device *dev)
^~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function]
static int mmpcam_suspend(struct device *dev)
^~~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
static int mmpcam_runtime_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
static int mmpcam_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~Mark them as __maybe_unused to fix this.
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/marvell-ccic/mmp-driver.c +4 -4
@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;
@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;
@@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)return 0 ; } -static int mmpcam_suspend (struct device *dev) +static int __maybe_unused mmpcam_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);
@@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)return 0 ; } -static int mmpcam_resume (struct device *dev) +static int __maybe_unused mmpcam_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);
Signature · 1 line
2.17.1
Quoted 15 lines · YueHaibing
If
CONFIG_PMis n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
static intmmpcam_resume(struct device *dev)^~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function] static int mmpcam_suspend(struct device *dev) ^~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines
Mark them as
__maybe_unusedto fix this.Reported-by Hulk Robot <[email protected]>Signed-off-by YueHaibing <[email protected]>
Your colleague seems to sent out an equivalent patch:
https://lore.kernel.org/lkml/[email protected]/
Cheers
Lubo
Quoted 48 lines
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/platform/marvell-ccic/mmp-driver.c +4
-4@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)return 0 ; } -static int mmpcam_suspend (struct device *dev) +static int __maybe_unused mmpcam_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);@@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)return 0 ; } -static int mmpcam_resume (struct device *dev) +static int __maybe_unused mmpcam_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);Signature · 1 line
2.17.1
Quoted 16 lines · Lubomir Rintel
Quoted 15 lines · YueHaibing
If
CONFIG_PMis n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
static intmmpcam_resume(struct device *dev)^~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function] static int mmpcam_suspend(struct device *dev) ^~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines
Quoted 4 lines
Mark them as
__maybe_unusedto fix this.Reported-by Hulk Robot <[email protected]>Signed-off-by YueHaibing <[email protected]>Your colleague seems to sent out an equivalent patch:
https://lore.kernel.org/lkml/[email protected]/
This is my patch, paste an wrong link?
Quoted 55 lines
Cheers
LuboQuoted 48 lines
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/platform/marvell-ccic/mmp-driver.c +4
-4@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)return 0 ; } -static int mmpcam_suspend (struct device *dev) +static int __maybe_unused mmpcam_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);@@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)return 0 ; } -static int mmpcam_resume (struct device *dev) +static int __maybe_unused mmpcam_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);Signature · 1 line
2.17.1.
Quoted 19 lines · Yuehaibing
Quoted 18 lines · Lubomir Rintel
Quoted 17 lines · YueHaibing
If
CONFIG_PMis n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
static intmmpcam_resume(struct device *dev)^~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function] static int mmpcam_suspend(struct device *dev) ^~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~Mark them as
__maybe_unusedto fix this.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by YueHaibing <[email protected]>Your colleague seems to sent out an equivalent patch:
https://lore.kernel.org/lkml/[email protected]/This is my patch, paste an wrong link?
Indeed, sorry for the confusion.
The original mail only went to linux-media, not lkml, which is why I picked the wrong one from the archive. Here's the patch:
https://lore.kernel.org/linux-media/[email protected]/
Take care
Lubo
Quoted 57 lines
Quoted 56 lines
Cheers
LuboQuoted 48 lines
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/platform/marvell-ccic/mmp-driver.c +4
-4@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)return 0 ; } -static int mmpcam_suspend (struct device *dev) +static int __maybe_unused mmpcam_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);@@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)return 0 ; } -static int mmpcam_resume (struct device *dev) +static int __maybe_unused mmpcam_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);Signature · 1 line
2.17.1.
Quoted 26 lines · Lubomir Rintel
Quoted 25 lines · Yuehaibing
Quoted 23 lines · Lubomir Rintel
Quoted 15 lines · YueHaibing
If
CONFIG_PMis n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: ‘mmpcam_resume’ defined but not used [-Wunused-function]
static intmmpcam_resume(struct device *dev)^~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: ‘mmpcam_suspend’ defined but not used [-Wunused-function] static int mmpcam_suspend(struct device *dev) ^~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function] static int mmpcam_runtime_suspend(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~Quoted 4 lines
Mark them as
__maybe_unusedto fix this.Reported-by Hulk Robot <[email protected]>Signed-off-by YueHaibing <[email protected]>Your colleague seems to sent out an equivalent patch:
https://lore.kernel.org/lkml/[email protected]/
Quoted 8 lines
Quoted 1 line
This is my patch, paste an wrong link?
Indeed, sorry for the confusion.
The original mail only went to linux-media, not lkml, which is why I picked the wrong one from the archive. Here's the patch:
mmpcam_runtime_suspend/mmpcam_runtime_resume also should be cared, I'll adjust my patch based on it.
Quoted 64 lines
Take care
LuboQuoted 49 lines
Quoted 49 lines
Cheers
LuboQuoted 44 lines
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/media/platform/marvell-ccic/mmp-driver.c +4
-4@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;@@ -335,7 +335,7 @@ static int mmpcam_runtime_suspend(struct device *dev)return 0 ; } -static int mmpcam_suspend (struct device *dev) +static int __maybe_unused mmpcam_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);@@ -344,7 +344,7 @@ static int mmpcam_suspend(struct device *dev)return 0 ; } -static int mmpcam_resume (struct device *dev) +static int __maybe_unused mmpcam_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Signature · 1 line
2.17.1.
.
PATCH v2 1/1 media: marvell-ccic: Fix -Wunused-function warnings
In reply to YueHaibingIf CONFIG_PM is n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
static int mmpcam_runtime_suspend(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function]
static int mmpcam_runtime_resume(struct device *dev)
^~~~~~~~~~~~~~~~~~~~~Mark them as __maybe_unused to fix this.
---
v2: Adjust based on https://lore.kernel.org/linux-media/[email protected]/
--- drivers/media/platform/marvell-ccic/mmp-driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/marvell-ccic/mmp-driver.c +2 -2
@@ -307,7 +307,7 @@ static int mmpcam_platform_remove(struct platform_device *pdev)* Suspend/resume support. */ -static int mmpcam_runtime_resume (struct device *dev) +static int __maybe_unused mmpcam_runtime_resume (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;
@@ -321,7 +321,7 @@ static int mmpcam_runtime_resume(struct device *dev)return 0 ; } -static int mmpcam_runtime_suspend (struct device *dev) +static int __maybe_unused mmpcam_runtime_suspend (struct device *dev) {struct mmp_camera *cam =dev_get_drvdata (dev);struct mcam_camera *mcam = &cam->mcam;
Signature · 1 line
2.17.1
Quoted 9 lines · YueHaibing
If
CONFIG_PMis n, gcc warns:
drivers/media/platform/marvell-ccic/mmp-driver.c:324:12: warning: ‘mmpcam_runtime_suspend’ defined but not used [-Wunused-function]
static intmmpcam_runtime_suspend(struct device *dev)^~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/marvell-ccic/mmp-driver.c:310:12: warning: ‘mmpcam_runtime_resume’ defined but not used [-Wunused-function] static int mmpcam_runtime_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines
Mark them as
__maybe_unusedto fix this.Reported-by Hulk Robot <[email protected]>Signed-off-by YueHaibing <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds