Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Cc: linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Chenglin Xu <chenglin.xu@mediatek.com>,
	Sean Wang <sean.wang@mediatek.com>
Subject: Re: [PATCH RFC] regulator: mt6380: Fix unused array warning
Date: Fri, 29 Jul 2022 15:23:49 +0200	[thread overview]
Message-ID: <20220729152349.6a4801a5@endymion.delvare> (raw)
In-Reply-To: <decb7338-eeb8-3c0c-88f2-c0b00fb8b0e7@collabora.com>

On Thu, 28 Jul 2022 13:15:14 +0200, AngeloGioacchino Del Regno wrote:
> Il 27/07/22 13:26, Jean Delvare ha scritto:
> > With the following configuration options:
> > CONFIG_OF is not set
> > CONFIG_REGULATOR_MT6380=y
> > we get the following build warning:
> > 
> >    CC      drivers/regulator/mt6380-regulator.o
> > drivers/regulator/mt6380-regulator.c:322:34: warning: ‘mt6380_of_match’ defined but not used [-Wunused-const-variable=]
> > 
> > Fix this by annotating that array with __maybe_unused, as done in
> > various regulator drivers.  
> 
> I know I'm late to the party, but I would've preferred to see the
> of_match_ptr() dropped instead of adding a __maybe_unused.

Doing that for this driver would basically prevent the compiler from
dropping out the variable in the !CONFIG_OF case. If this is a valid
case (and I really would like Mediatek people to comment on that) then
I can't see how that would be an improvement.

-- 
Jean Delvare
SUSE L3 Support


      reply	other threads:[~2022-07-29 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 11:26 [PATCH RFC] regulator: mt6380: Fix unused array warning Jean Delvare
2022-07-27 12:01 ` Mark Brown
2022-07-27 12:08   ` Jean Delvare
2022-07-27 12:24     ` Mark Brown
2022-07-27 18:50       ` Jean Delvare
2022-07-27 20:10 ` Mark Brown
2022-07-28 11:15 ` AngeloGioacchino Del Regno
2022-07-29 13:23   ` Jean Delvare [this message]

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=20220729152349.6a4801a5@endymion.delvare \
    --to=jdelvare@suse.de \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=chenglin.xu@mediatek.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=sean.wang@mediatek.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