All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: "tiwai@suse.de" <tiwai@suse.de>,
	"broonie@kernel.org" <broonie@kernel.org>,
	Support Opensource <Support.Opensource@diasemi.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 04/11] ASoC: codecs: da7219: fix 'defined but not used' warning
Date: Fri, 3 Jul 2020 09:33:06 +0000	[thread overview]
Message-ID: <DB6PR1001MB1096535996028B7DE0D136DC806A0@DB6PR1001MB1096.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20200701182422.81496-5-pierre-louis.bossart@linux.intel.com>

On 01 July 2020 19:24, Pierre-Louis Bossart wrote:

> fix W=1 warning
> 
> sound/soc/codecs/da7219.c:1711:36: warning: 'da7219_acpi_match'
> defined but not used [-Wunused-const-variable=]
>  1711 | static const struct acpi_device_id da7219_acpi_match[] = {
>       |                                    ^~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/codecs/da7219.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
> index f2520a6c7875..153ea30b5a8f 100644
> --- a/sound/soc/codecs/da7219.c
> +++ b/sound/soc/codecs/da7219.c
> @@ -1708,11 +1708,13 @@ static const struct of_device_id da7219_of_match[] =
> {
>  };
>  MODULE_DEVICE_TABLE(of, da7219_of_match);
> 
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id da7219_acpi_match[] = {
>  	{ .id = "DLGS7219", },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, da7219_acpi_match);
> +#endif

I think this will break non-ACPI builds as this symbol is used in the
declaration of 'da7219_i2c_driver', without conditional compilation surrounding
it. Unless of course I'm missing something. Could we instead use
'__maybe_unused' to avoid this warning?

> 
>  static enum da7219_micbias_voltage
>  	da7219_fw_micbias_lvl(struct device *dev, u32 val)
> --
> 2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: Support Opensource <Support.Opensource@diasemi.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"tiwai@suse.de" <tiwai@suse.de>,
	open list <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	"broonie@kernel.org" <broonie@kernel.org>
Subject: RE: [PATCH 04/11] ASoC: codecs: da7219: fix 'defined but not used' warning
Date: Fri, 3 Jul 2020 09:33:06 +0000	[thread overview]
Message-ID: <DB6PR1001MB1096535996028B7DE0D136DC806A0@DB6PR1001MB1096.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20200701182422.81496-5-pierre-louis.bossart@linux.intel.com>

On 01 July 2020 19:24, Pierre-Louis Bossart wrote:

> fix W=1 warning
> 
> sound/soc/codecs/da7219.c:1711:36: warning: 'da7219_acpi_match'
> defined but not used [-Wunused-const-variable=]
>  1711 | static const struct acpi_device_id da7219_acpi_match[] = {
>       |                                    ^~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/codecs/da7219.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
> index f2520a6c7875..153ea30b5a8f 100644
> --- a/sound/soc/codecs/da7219.c
> +++ b/sound/soc/codecs/da7219.c
> @@ -1708,11 +1708,13 @@ static const struct of_device_id da7219_of_match[] =
> {
>  };
>  MODULE_DEVICE_TABLE(of, da7219_of_match);
> 
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id da7219_acpi_match[] = {
>  	{ .id = "DLGS7219", },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, da7219_acpi_match);
> +#endif

I think this will break non-ACPI builds as this symbol is used in the
declaration of 'da7219_i2c_driver', without conditional compilation surrounding
it. Unless of course I'm missing something. Could we instead use
'__maybe_unused' to avoid this warning?

> 
>  static enum da7219_micbias_voltage
>  	da7219_fw_micbias_lvl(struct device *dev, u32 val)
> --
> 2.25.1


  reply	other threads:[~2020-07-03  9:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 18:24 [PATCH 00/11] ASoC: codecs: fix kernel-doc and W=1 warnings Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 01/11] ASoC: codecs: ak4458: fix 'set but not used' warning Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 02/11] ASoC: codecs: cros_ec_codec: fix 'defined " Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 03/11] ASoC: codecs: da7210: fix kernel-doc Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-03  9:22   ` Adam Thomson
2020-07-03  9:22     ` Adam Thomson
2020-07-01 18:24 ` [PATCH 04/11] ASoC: codecs: da7219: fix 'defined but not used' warning Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-03  9:33   ` Adam Thomson [this message]
2020-07-03  9:33     ` Adam Thomson
2020-07-03  9:57     ` Adam Thomson
2020-07-03  9:57       ` Adam Thomson
2020-07-01 18:24 ` [PATCH 05/11] ASoC: codecs: es8316: " Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 06/11] ASoC: codecs: max98390: " Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 07/11] ASoC: codecs: rt*: " Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 08/11] ASoC: codecs: rt5659: add _maybe_unused as needed Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 09/11] ASoC: codecs: rt5631: fix kernel-doc Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 10/11] ASoC: codecs: tlv320aic26: fix kernel-doc warning Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart
2020-07-01 18:24 ` [PATCH 11/11] ASoC: codecs: jz4770: add _maybe_unused as needed Pierre-Louis Bossart
2020-07-01 18:24   ` Pierre-Louis Bossart

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=DB6PR1001MB1096535996028B7DE0D136DC806A0@DB6PR1001MB1096.EURPRD10.PROD.OUTLOOK.COM \
    --to=adam.thomson.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=tiwai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.