linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: Jean Delvare <jdelvare@suse.de>,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	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: Thu, 28 Jul 2022 13:15:14 +0200	[thread overview]
Message-ID: <decb7338-eeb8-3c0c-88f2-c0b00fb8b0e7@collabora.com> (raw)
In-Reply-To: <20220727132637.76d6073f@endymion.delvare>

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.

Cheers,
Angelo

> 
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/all/202207240252.ZY5hSCNB-lkp@intel.com/
> Cc: Liam Girdwood <lgirdwood@gmail.com>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: Chenglin Xu <chenglin.xu@mediatek.com>
> ---
> This assumes that the mt6380 driver can be used without OF support.
> However, I can't find any in-tree piece of code instantiating the
> "mt6380-regulator" platform device by name. So unless there's an
> out-of-tree user, a better fix would be to remove mt6380_platform_ids
> and make the driver depend on OF. Chenglin, would that be OK with
> you?
> 
>   drivers/regulator/mt6380-regulator.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-5.18.orig/drivers/regulator/mt6380-regulator.c	2022-07-27 11:55:21.672421481 +0200
> +++ linux-5.18/drivers/regulator/mt6380-regulator.c	2022-07-27 12:01:53.151833378 +0200
> @@ -319,7 +319,7 @@ static const struct platform_device_id m
>   };
>   MODULE_DEVICE_TABLE(platform, mt6380_platform_ids);
>   
> -static const struct of_device_id mt6380_of_match[] = {
> +static const struct of_device_id  __maybe_unused mt6380_of_match[] = {
>   	{ .compatible = "mediatek,mt6380-regulator", },
>   	{ /* sentinel */ },
>   };
> 

  parent reply	other threads:[~2022-07-28 11:15 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 [this message]
2022-07-29 13:23   ` Jean Delvare

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=decb7338-eeb8-3c0c-88f2-c0b00fb8b0e7@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=chenglin.xu@mediatek.com \
    --cc=jdelvare@suse.de \
    --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;
as well as URLs for NNTP newsgroup(s).