* [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match
@ 2016-01-20 11:46 Arnd Bergmann
2016-01-21 16:56 ` Applied "ASoC: rt5659: avoid unused variable warning for rt5659_acpi_match" to the asoc tree Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2016-01-20 11:46 UTC (permalink / raw)
To: Mark Brown
Cc: Oder Chiou, alsa-devel, Liam Girdwood, linux-kernel, Bard Liao,
linux-arm-kernel
The newly added rt5659 codec driver unconditionally defines an
ACPI device match table but then uses ACPI_PTR() to remove the
only reference to it, so we get a harmless build warning:
sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
static struct acpi_device_id rt5659_acpi_match[] = {
This changes both the OF match table and the ACPI match table
to follow the same style, using ACPI_PTR/of_match_ptr to
make the reference conditional, and using an #ifdef to hide
the table. This also adds the missing MODULE_DEVICE_TABLE for
the OF case and adapts the formatting to the same style.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
v3: actually builds with CONFIG_OF enabled, testing in a couple of
configurations with and without OF
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index c166d9394c69..fb8ea05c0de1 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -4183,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client)
regmap_write(rt5659->regmap, RT5659_RESET, 0);
}
+#ifdef CONFIG_OF
static const struct of_device_id rt5659_of_match[] = {
{ .compatible = "realtek,rt5658", },
{ .compatible = "realtek,rt5659", },
- {},
+ { },
};
+MODULE_DEVICE_TABLE(of, rt5659_of_match);
+#endif
+#ifdef CONFIG_ACPI
static struct acpi_device_id rt5659_acpi_match[] = {
- { "10EC5658", 0},
- { "10EC5659", 0},
- { },
+ { "10EC5658", 0, },
+ { "10EC5659", 0, },
+ { },
};
MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match);
+#endif
struct i2c_driver rt5659_i2c_driver = {
.driver = {
.name = "rt5659",
.owner = THIS_MODULE,
- .of_match_table = rt5659_of_match,
+ .of_match_table = of_match_ptr(rt5659_of_match),
.acpi_match_table = ACPI_PTR(rt5659_acpi_match),
},
.probe = rt5659_i2c_probe,
^ permalink raw reply related [flat|nested] 5+ messages in thread* Applied "ASoC: rt5659: avoid unused variable warning for rt5659_acpi_match" to the asoc tree
2016-01-20 11:46 [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match Arnd Bergmann
@ 2016-01-21 16:56 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-01-21 16:56 UTC (permalink / raw)
To: Arnd Bergmann, Mark Brown; +Cc: alsa-devel
The patch
ASoC: rt5659: avoid unused variable warning for rt5659_acpi_match
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 2256b8d2ff6c8e994161ab15b6e6d0314d3174ae Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Wed, 20 Jan 2016 12:46:24 +0100
Subject: [PATCH] ASoC: rt5659: avoid unused variable warning for
rt5659_acpi_match
The newly added rt5659 codec driver unconditionally defines an
ACPI device match table but then uses ACPI_PTR() to remove the
only reference to it, so we get a harmless build warning:
sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
static struct acpi_device_id rt5659_acpi_match[] = {
This changes both the OF match table and the ACPI match table
to follow the same style, using ACPI_PTR/of_match_ptr to
make the reference conditional, and using an #ifdef to hide
the table. This also adds the missing MODULE_DEVICE_TABLE for
the OF case and adapts the formatting to the same style.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/rt5659.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index c166d9394c69..fb8ea05c0de1 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -4183,24 +4183,29 @@ void rt5659_i2c_shutdown(struct i2c_client *client)
regmap_write(rt5659->regmap, RT5659_RESET, 0);
}
+#ifdef CONFIG_OF
static const struct of_device_id rt5659_of_match[] = {
{ .compatible = "realtek,rt5658", },
{ .compatible = "realtek,rt5659", },
- {},
+ { },
};
+MODULE_DEVICE_TABLE(of, rt5659_of_match);
+#endif
+#ifdef CONFIG_ACPI
static struct acpi_device_id rt5659_acpi_match[] = {
- { "10EC5658", 0},
- { "10EC5659", 0},
- { },
+ { "10EC5658", 0, },
+ { "10EC5659", 0, },
+ { },
};
MODULE_DEVICE_TABLE(acpi, rt5659_acpi_match);
+#endif
struct i2c_driver rt5659_i2c_driver = {
.driver = {
.name = "rt5659",
.owner = THIS_MODULE,
- .of_match_table = rt5659_of_match,
+ .of_match_table = of_match_ptr(rt5659_of_match),
.acpi_match_table = ACPI_PTR(rt5659_acpi_match),
},
.probe = rt5659_i2c_probe,
--
2.7.0.rc3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match
@ 2016-01-20 10:43 Arnd Bergmann
2016-01-20 10:45 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2016-01-20 10:43 UTC (permalink / raw)
To: broonie
Cc: Oder Chiou, alsa-devel, Liam Girdwood, linux-kernel, Bard Liao,
linux-arm-kernel
The newly added rt5659 codec driver unconditionally defines an
ACPI device match table but then uses ACPI_PTR() to remove the
only reference to it, so we get a harmless build warning:
sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
static struct acpi_device_id rt5659_acpi_match[] = {
This removes the ACPI_PTR() to avoid the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
This is a harmless regression against v4.4, found on ARM randconfig builds
diff --git a/sound/soc/codecs/rt5659.c b/sound/soc/codecs/rt5659.c
index c166d9394c69..5a1d789ba58d 100644
--- a/sound/soc/codecs/rt5659.c
+++ b/sound/soc/codecs/rt5659.c
@@ -4201,7 +4201,7 @@ struct i2c_driver rt5659_i2c_driver = {
.name = "rt5659",
.owner = THIS_MODULE,
.of_match_table = rt5659_of_match,
- .acpi_match_table = ACPI_PTR(rt5659_acpi_match),
+ .acpi_match_table = rt5659_acpi_match,
},
.probe = rt5659_i2c_probe,
.remove = rt5659_i2c_remove,
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match
2016-01-20 10:43 [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match Arnd Bergmann
@ 2016-01-20 10:45 ` Mark Brown
2016-01-20 10:58 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2016-01-20 10:45 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Oder Chiou, alsa-devel, Liam Girdwood, linux-kernel, Bard Liao,
linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]
On Wed, Jan 20, 2016 at 11:43:48AM +0100, Arnd Bergmann wrote:
> The newly added rt5659 codec driver unconditionally defines an
> ACPI device match table but then uses ACPI_PTR() to remove the
> only reference to it, so we get a harmless build warning:
> sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
> static struct acpi_device_id rt5659_acpi_match[] = {
> This removes the ACPI_PTR() to avoid the warning.
Why is this a better fix than conditionally defining the table?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match
2016-01-20 10:45 ` Mark Brown
@ 2016-01-20 10:58 ` Arnd Bergmann
0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2016-01-20 10:58 UTC (permalink / raw)
To: Mark Brown
Cc: Oder Chiou, alsa-devel, Liam Girdwood, linux-kernel, Bard Liao,
linux-arm-kernel
On Wednesday 20 January 2016 10:45:55 Mark Brown wrote:
> On Wed, Jan 20, 2016 at 11:43:48AM +0100, Arnd Bergmann wrote:
> > The newly added rt5659 codec driver unconditionally defines an
> > ACPI device match table but then uses ACPI_PTR() to remove the
> > only reference to it, so we get a harmless build warning:
>
> > sound/soc/codecs/rt5659.c:4200:30: warning: 'rt5659_acpi_match' defined but not used [-Wunused-variable]
> > static struct acpi_device_id rt5659_acpi_match[] = {
>
> > This removes the ACPI_PTR() to avoid the warning.
>
> Why is this a better fix than conditionally defining the table?
I'm not overly fond of adding #ifdef if it can be avoided. In this case,
both approaches seemed reasonable (either add an #ifdef or waste a couple
of bytes), and I picked at random. I'll send you the alternative as well,
please apply whichever one you prefer.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-21 16:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 11:46 [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match Arnd Bergmann
2016-01-21 16:56 ` Applied "ASoC: rt5659: avoid unused variable warning for rt5659_acpi_match" to the asoc tree Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2016-01-20 10:43 [PATCH] ASoC: avoid unused variable warning for rt5659_acpi_match Arnd Bergmann
2016-01-20 10:45 ` Mark Brown
2016-01-20 10:58 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox