From: Nathan Chancellor <nathan@kernel.org>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Daniel Vetter <daniel.vetter@intel.com>,
David Airlie <airlied@linux.ie>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-rpi-kernel@lists.infradead.org,
Florian Fainelli <f.fainelli@gmail.com>,
Nicolas Saenz Julienne <nsaenz@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Randy Dunlap <rdunlap@infradead.org>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] drm/vc4: hdmi: Fix defined but not used warning
Date: Thu, 23 Sep 2021 09:24:12 -0700 [thread overview]
Message-ID: <YUyqLJ3tNNl7skCZ@archlinux-ax161> (raw)
In-Reply-To: <20210923155728.703312-1-maxime@cerno.tech>
On Thu, Sep 23, 2021 at 05:57:28PM +0200, Maxime Ripard wrote:
> On platforms without CONFIG_PM, SET_RUNTIME_PM_OPS will be a nop and the
> functions vc4_hdmi_runtime_resume and vc4_hdmi_runtime_suspend will not
> be used anywhere leading to
>
> warning: 'vc4_hdmi_runtime_suspend' defined but not used [-Wunused-function]
>
> Since we select CONFIG_PM anyway, vc4_hdmi_runtime_suspend() and
> vc4_hdmi_runtime_suspend() will always be used and we can thus always
> assign them in struct dev_pm_ops without using the SET_RUNTIME_PM_OPS
> macro.
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
> ---
>
> I'm not sure how to merge this one, since this commit has been reverted
> in Linus tree, and un-reverted in linux-next. Should we wait a bit until
> the reworked version of the original commit has been merged again?
>
> Maxime
> ---
> drivers/gpu/drm/vc4/vc4_hdmi.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
> index 500cdd56b335..5cf3a9aae147 100644
> --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
> +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
> @@ -2411,9 +2411,8 @@ static const struct of_device_id vc4_hdmi_dt_match[] = {
> };
>
> static const struct dev_pm_ops vc4_hdmi_pm_ops = {
> - SET_RUNTIME_PM_OPS(vc4_hdmi_runtime_suspend,
> - vc4_hdmi_runtime_resume,
> - NULL)
> + .runtime_resume = vc4_hdmi_runtime_resume,
> + .runtime_suspend = vc4_hdmi_runtime_suspend,
> };
>
> struct platform_driver vc4_hdmi_driver = {
> --
> 2.31.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-09-23 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-23 15:57 [PATCH] drm/vc4: hdmi: Fix defined but not used warning Maxime Ripard
2021-09-23 16:24 ` Nathan Chancellor [this message]
2021-09-23 16:54 ` Linus Torvalds
2021-09-24 8:12 ` Maxime Ripard
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=YUyqLJ3tNNl7skCZ@archlinux-ax161 \
--to=nathan@kernel.org \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=f.fainelli@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=maxime@cerno.tech \
--cc=nsaenz@kernel.org \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
--cc=tzimmermann@suse.de \
/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).