diff mbox series

[v2,-next] media: marvell-ccic: Fix -Wunused-function warnings

Message ID 20200911112707.32232-1-yuehaibing@huawei.com (mailing list archive)
State New, archived
Headers show
Series [v2,-next] media: marvell-ccic: Fix -Wunused-function warnings | expand

Commit Message

Yue Haibing Sept. 11, 2020, 11:27 a.m. UTC
If 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.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: Adjust based on https://lore.kernel.org/linux-media/20200909112921.5116-1-weiyongjun1@huawei.com/
---
 drivers/media/platform/marvell-ccic/mmp-driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Geert Uytterhoeven Oct. 14, 2020, 1:50 p.m. UTC | #1
On Fri, Sep 11, 2020 at 1:50 PM YueHaibing <yuehaibing@huawei.com> wrote:
> If 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.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
index c4b28a00a3a2..c046a0ff3b85 100644
--- a/drivers/media/platform/marvell-ccic/mmp-driver.c
+++ b/drivers/media/platform/marvell-ccic/mmp-driver.c
@@ -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;