[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220729152349.6a4801a5@endymion.delvare>
Date: Fri, 29 Jul 2022 15:23:49 +0200
From: Jean Delvare <jdelvare@...e.de>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Chenglin Xu <chenglin.xu@...iatek.com>,
Sean Wang <sean.wang@...iatek.com>
Subject: Re: [PATCH RFC] regulator: mt6380: Fix unused array warning
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
Powered by blists - more mailing lists