linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: marvell-ccic: Pass __maybe_unused to the PM hooks
@ 2020-09-14 11:42 Fabio Estevam
  2020-09-14 15:28 ` Lubomir Rintel
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2020-09-14 11:42 UTC (permalink / raw)
  To: hverkuil-cisco; +Cc: lkundrak, mchehab, linux-media, Fabio Estevam

Building for the riscv allmodconfig target leads to the following
build warnings:

drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: 'mmpcam_resume' defined but not used [-Wunused-function]
drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: 'mmpcam_suspend' defined but not used [-Wunused-function]

This happens because the generated .config does not select CONFIG_PM and 
CONFIG_PM_SLEEP options.

Mark the PM hooks as __maybe_unused to avoid such warnings.

Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
index c4b28a00a3a2..097d7775e1ee 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 __maybe_unused int 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 __maybe_unused int 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 __maybe_unused int 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 __maybe_unused int mmpcam_resume(struct device *dev)
 {
 	struct mmp_camera *cam = dev_get_drvdata(dev);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: marvell-ccic: Pass __maybe_unused to the PM hooks
  2020-09-14 11:42 [PATCH] media: marvell-ccic: Pass __maybe_unused to the PM hooks Fabio Estevam
@ 2020-09-14 15:28 ` Lubomir Rintel
  0 siblings, 0 replies; 2+ messages in thread
From: Lubomir Rintel @ 2020-09-14 15:28 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: hverkuil-cisco, mchehab, linux-media

On Mon, Sep 14, 2020 at 08:42:43AM -0300, Fabio Estevam wrote:
> Building for the riscv allmodconfig target leads to the following
> build warnings:
> 
> drivers/media/platform/marvell-ccic/mmp-driver.c:347:12: warning: 'mmpcam_resume' defined but not used [-Wunused-function]
> drivers/media/platform/marvell-ccic/mmp-driver.c:338:12: warning: 'mmpcam_suspend' defined but not used [-Wunused-function]
> 
> This happens because the generated .config does not select CONFIG_PM and 
> CONFIG_PM_SLEEP options.
> 
> Mark the PM hooks as __maybe_unused to avoid such warnings.
> 
> Reported-by: Olof's autobuilder <build@lixom.net>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Thanks for the patch.
Two equivalent patches have been sent to linux-media@ before though.

Cheers
Lubo

> ---
>  drivers/media/platform/marvell-ccic/mmp-driver.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/marvell-ccic/mmp-driver.c b/drivers/media/platform/marvell-ccic/mmp-driver.c
> index c4b28a00a3a2..097d7775e1ee 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 __maybe_unused int 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 __maybe_unused int 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 __maybe_unused int 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 __maybe_unused int mmpcam_resume(struct device *dev)
>  {
>  	struct mmp_camera *cam = dev_get_drvdata(dev);
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-14 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 11:42 [PATCH] media: marvell-ccic: Pass __maybe_unused to the PM hooks Fabio Estevam
2020-09-14 15:28 ` Lubomir Rintel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).