ASoC: tas2781: fix unused-const-variable warning
Subsystems (3)
PATCH 1/1 ASoC: tas2781: fix unused-const-variable warning
From: Arnd Bergmann <[email protected]>
When both CONFIG_OF and CONFIG_ACPI are disabled, the ID table is not referenced any more:
sound/soc/codecs/tas2781-i2c.c:102:35: error: 'tasdevice_id' defined but not used [-Werror=unused-const-variable=]
102 | static const struct i2c_device_id tasdevice_id[] = {
| ^~~~~~~~~~~~Remove the #ifdef checks and just include the ID tables unconditionally to get a clean build in all configurations. The code already uses IS_ENABLED() checks for both to benefit from dead code elimination and the ID tables are small enough that they can just be included all the time.
--- sound/soc/codecs/tas2781-i2c.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
sound/soc/codecs/tas2781-i2c.c +2 -8
@@ -122,7 +122,6 @@ static const struct i2c_device_id tasdevice_id[] = { {} }; -#ifdef CONFIG_OF static const struct of_device_id tasdevice_of_match[] = { { .compatible ="ti,tas2020" , .data = &tasdevice_id[TAS2020 ] }, { .compatible ="ti,tas2118" , .data = &tasdevice_id[TAS2118 ] },
@@ -146,7 +145,6 @@ static const struct of_device_id tasdevice_of_match[] = { {}, };MODULE_DEVICE_TABLE (of, tasdevice_of_match); -#endif /** * tas2781_digital_getvol - get the volum control
@@ -2083,7 +2081,6 @@ static void tasdevice_i2c_remove(struct i2c_client *client)tasdevice_remove (tas_priv); } -#ifdef CONFIG_ACPI static const struct acpi_device_id tasdevice_acpi_match[] = { {"TXNW2020" , (kernel_ulong_t)&tasdevice_id[TAS2020 ] }, {"TXNW2118" , (kernel_ulong_t)&tasdevice_id[TAS2118 ] },
@@ -2108,15 +2105,12 @@ static const struct acpi_device_id tasdevice_acpi_match[] = { };MODULE_DEVICE_TABLE (acpi, tasdevice_acpi_match); -#endif static struct i2c_driver tasdevice_i2c_driver = { .driver = { .name ="tasdev-codec" , - .of_match_table =of_match_ptr (tasdevice_of_match), -#ifdef CONFIG_ACPI - .acpi_match_table =ACPI_PTR (tasdevice_acpi_match), -#endif + .of_match_table = tasdevice_of_match, + .acpi_match_table = tasdevice_acpi_match, }, .probe = tasdevice_i2c_probe, .remove = tasdevice_i2c_remove,
Signature · 1 line
2.39.5
Mark Brown
maintainerQuoted 1 line · Arnd Bergmann
ASoC: tas2781: fix unused-const-variable warning
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.1
Thanks!
[1/1] ASoC: tas2781: fix unused-const-variable warning
https://git.kernel.org/broonie/sound/c/bc9b1ebaa762
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