ASoC: rt5645: fix build warning
Subsystems (3)
PATCH 1/1 ASoC: rt5645: fix build warning
We were getting build warning about "Section mismatch". dmi_platform_intel_broadwell is being referenced from the probe function rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with __initdata.
--- sound/soc/codecs/rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt5645.c +1 -1
@@ -3244,7 +3244,7 @@ static int buddy_quirk_cb(const struct dmi_system_id *id)return 1 ; } -static struct dmi_system_id dmi_platform_intel_broadwell[]__initdata = { +static struct dmi_system_id dmi_platform_intel_broadwell[] = { { .ident ="Chrome Buddy" , .callback = buddy_quirk_cb,
Signature · 1 line
1.9.1
Mark Brown
maintainersound/soc/codecs/rt5645.c static int buddy_quirk_cb(const struct dmi_system_id *id) · line 3247
Quoted 9 lines · Sudip Mukherjee
We were getting build warning about "Section mismatch".
dmi_platform_intel_broadwellis being referenced from the probe functionrt5645_i2c_probe(), butdmi_platform_intel_broadwellwas marked with__initdata.Signed-off-by Sudip Mukherjee <[email protected]>sound/soc/codecs/rt5645.c +1
-1-static struct dmi_system_id dmi_platform_intel_broadwell[]__initdata = { +static struct dmi_system_id dmi_platform_intel_broadwell[] = {
This doesn't seem like the obvious fix - why are we not annotating the probe function suitably (or alternatively if we can't why does __initdata still exist)?
Quoted 6 lines · Mark Brown
Quoted 5 lines · Sudip Mukherjee
We were getting build warning about "Section mismatch".
dmi_platform_intel_broadwellis being referenced from the probe functionrt5645_i2c_probe(), butdmi_platform_intel_broadwellwas marked with__initdata.
Quoted 8 lines
sound/soc/codecs/rt5645.c static int buddy_quirk_cb(const struct dmi_system_id *id) · line 3247
Quoted 4 lines
Signed-off-by Sudip Mukherjee <[email protected]>sound/soc/codecs/rt5645.c +1
-1-static struct dmi_system_id dmi_platform_intel_broadwell[]__initdata = { +static struct dmi_system_id dmi_platform_intel_broadwell[] = {This doesn't seem like the obvious fix - why are we not annotating the probe function suitably (or alternatively if we can't why does
__initdatastill exist)?
probe function should not be __init. probe can be called anytime after the module has been loaded.__initdata still exists as that part of the code was added by e9159e7577cf ("ASoC: rt5645: Add dmi for Broadwell") which is a very recent modification and I think that has been added by mistake. One more argument in my favor:
The use in probe function is
if (dmi_check_system(dmi_platform_intel_braswell) ||
dmi_check_system(dmi_platform_intel_broadwell))
dmi_platform_intel_braswell is not marked as __initdata but dmi_platform_intel_broadwell is marked but they both have same use at the same place.
regards
sudip
Jarkko Nikula
Reviewed-byQuoted 26 lines · Sudip Mukherjee
Quoted 6 lines · Mark Brown
Quoted 5 lines · Sudip Mukherjee
We were getting build warning about "Section mismatch".
dmi_platform_intel_broadwellis being referenced from the probe functionrt5645_i2c_probe(), butdmi_platform_intel_broadwellwas marked with__initdata.Quoted 8 lines
sound/soc/codecs/rt5645.c static int buddy_quirk_cb(const struct dmi_system_id *id) · line 3247
Quoted 4 lines
Signed-off-by Sudip Mukherjee <[email protected]>sound/soc/codecs/rt5645.c +1
-1-static struct dmi_system_id dmi_platform_intel_broadwell[]__initdata = { +static struct dmi_system_id dmi_platform_intel_broadwell[] = {This doesn't seem like the obvious fix - why are we not annotating the probe function suitably (or alternatively if we can't why does
__initdatastill exist)?probe function should not be
__init. probe can be called anytime after the module has been loaded.__initdatastill exists as that part of the code was added bye9159e7577cf("ASoC: rt5645: Add dmi for Broadwell") which is a very recent modification and I think that has been added by mistake. One more argument in my favor:
The use in probe function is
if (dmi_check_system(dmi_platform_intel_braswell)||
dmi_check_system(dmi_platform_intel_broadwell))
Quoted 4 lines
dmi_platform_intel_braswellis not marked as__initdatabutdmi_platform_intel_broadwellis marked but they both have same use at the same place.
If one really wants to save a few bytes then one could annotate this it with __initdata_or_module (very low use in kernel) but I don't think it's worth of effort and probably should be done for other sections here too by another patch.
To me this patch looks a right thing to do at the moment.
Mark Brown
maintainerApplied "ASoC: rt5645: fix build warning" to the asoc tree
In reply to Sudip MukherjeeThe patch
ASoC: rt5645: fix build warning
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
Quoted 1 line
From
dc542fb4179a104fc73760a2da0fd78f68f70d6dMon Sep 17 00:00:00 2001
From: Sudip Mukherjee <[email protected]>
Date: Wed, 7 Oct 2015 17:52:12 +0530
Subject: [PATCH] ASoC: rt5645: fix build warning
We were getting build warning about "Section mismatch". dmi_platform_intel_broadwell is being referenced from the probe function rt5645_i2c_probe(), but dmi_platform_intel_broadwell was marked with __initdata.
--- sound/soc/codecs/rt5645.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt5645.c +1 -1
@@ -3241,7 +3241,7 @@ static int buddy_quirk_cb(const struct dmi_system_id *id)return 1 ; } -static struct dmi_system_id dmi_platform_intel_broadwell[]__initdata = { +static struct dmi_system_id dmi_platform_intel_broadwell[] = { { .ident ="Chrome Buddy" , .callback = buddy_quirk_cb,
Signature · 1 line
2.5.0