linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.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>,
	linux-rpi-kernel@lists.infradead.org,
	 Florian Fainelli <f.fainelli@gmail.com>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	 Linux ARM <linux-arm-kernel@lists.infradead.org>,
	 Nathan Chancellor <nathan@kernel.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:54:06 -0700	[thread overview]
Message-ID: <CAHk-=wgKLVDW+c1G1Q1m7nE9o4oX_XyiOXx5+Yoih06JA4VY7Q@mail.gmail.com> (raw)
In-Reply-To: <20210923155728.703312-1-maxime@cerno.tech>

On Thu, Sep 23, 2021 at 8:57 AM Maxime Ripard <maxime@cerno.tech> wrote:
>
> 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.

This cannot be true.

If CONFIG_PM is always enabled, then the patch is a no-op, and the
warning you quote cannot happen:

   warning: 'vc4_hdmi_runtime_suspend' defined but not used [-Wunused-function]

So this patch is very obviously broken, the message is misleading, and
the claims in your commit message cannot _possibly_ be true.

Maxime, this kind of "respond to bug reports with random contents"
most not continue.

You need to actually look at what the reporter is reporting, and think
about the code. Because the above fix is broken, broken, broken.

The way people fix this is by either making the function definitions
be conditional on their uses - so that the compiler removes them
entirely - or mark them as __maybe_unused. Then a smart _linker_ can
actually remove the code if people use the smarter linker options.

But responding with a patch that claims something that clearly isn't
true is not a valid response.

                   Linus

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-09-23 16:57 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
2021-09-23 16:54 ` Linus Torvalds [this message]
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='CAHk-=wgKLVDW+c1G1Q1m7nE9o4oX_XyiOXx5+Yoih06JA4VY7Q@mail.gmail.com' \
    --to=torvalds@linux-foundation.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=nathan@kernel.org \
    --cc=nsaenz@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --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).