linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [media] s5p-fimc: Only build suspend/resume for PM
Date: Thu, 2 Oct 2014 10:43:21 -0300	[thread overview]
Message-ID: <20141002104321.0b5b6aa2@recife.lan> (raw)
In-Reply-To: <1412239691-28719-1-git-send-email-thierry.reding@gmail.com>

Em Thu, 02 Oct 2014 10:48:11 +0200
Thierry Reding <thierry.reding@gmail.com> escreveu:

> From: Thierry Reding <treding@nvidia.com>
> 
> If power management is disabled these functions become unused, so there
> is no reason to build them. This fixes a couple of build warnings when
> PM(_SLEEP,_RUNTIME) is not enabled.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/media/platform/exynos4-is/fimc-core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c
> index b70fd996d794..8e7435bfa1f9 100644
> --- a/drivers/media/platform/exynos4-is/fimc-core.c
> +++ b/drivers/media/platform/exynos4-is/fimc-core.c
> @@ -832,6 +832,7 @@ err:
>  	return -ENXIO;
>  }
>  
> +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
>  static int fimc_m2m_suspend(struct fimc_dev *fimc)
>  {
>  	unsigned long flags;
> @@ -870,6 +871,7 @@ static int fimc_m2m_resume(struct fimc_dev *fimc)
>  
>  	return 0;
>  }
> +#endif

The patch obviously is correct, but I'm wandering if aren't there a way
to avoid the if/endif.

Not tested here, but perhaps if we mark those functions as inline, the
C compiler would do the right thing without generating any warnings.

If not, maybe we could use some macro like:

#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
	#define PM_SLEEP_FUNC
#else
	#define PM_SLEEP_FUNC	inline
#endif

And put it at pm.h.

That should be enough to shut up to warning without adding any footprint
if PM is disabled.

Regards,
Mauro

  reply	other threads:[~2014-10-02 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-02  8:48 [PATCH] [media] s5p-fimc: Only build suspend/resume for PM Thierry Reding
2014-10-02 13:43 ` Mauro Carvalho Chehab [this message]
2014-10-02 13:50   ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141002104321.0b5b6aa2@recife.lan \
    --to=mchehab@osg.samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).