[alsa-devel] [PATCH v2 0/5] ASOC: fix sparse warnings
Hi,
This patchset updates my previous one, and for Linux 4.8-rc8. http://mailman.alsa-project.org/pipermail/alsa-devel/2016-July/110466.html
This is to fix some sparse warnings in ALSA SoC part. Below items are going to be fixed: * fix a condition statement with a logical operation * purge old way to initialize array * complement missing 'static' and 'const' qualifier for file local symbols
Takashi Sakamoto (5): ASOC: da7219: fix inappropriate condition statement ASOC: sst-bxt-rt298: fix obsoleted initializers for array ASOC: sst-bxt-da7219_max98357a: fix obsoleted initializers for array ASOC: rt5616: add static qualifier for file local symbols ASOC: tpa6130a2: add static qualifier for file local symbols
sound/soc/codecs/da7219.c | 2 +- sound/soc/codecs/rt5616.c | 4 ++-- sound/soc/codecs/tpa6130a2.c | 2 +- sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 ++++++------ sound/soc/intel/boards/bxt_rt298.c | 14 +++++++------- 5 files changed, 17 insertions(+), 17 deletions(-)
Sparse reports a below warning.
sound/soc/codecs/da7219.c:804:57: warning: dubious: x & !y
The line includes a condition statement; '(a < b) & !c'. Practically, the evaluated value of this statement equals to the value of '(a < b) && !c'. Although, it's not an usual way to use bitwise operations as logical operations to several conditions.
This commit fixes the bug.
Fixes: 6d817c0e9fd7 ("ASoC: codecs: Add da7219 codec driver") Acked-by: Adam Thomson Adam.Thomson.Opensource@diasemi.com Cc: Support Opensource support.opensource@diasemi.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/soc/codecs/da7219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 50ea943..b9fa8fe 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -801,7 +801,7 @@ static int da7219_dai_event(struct snd_soc_dapm_widget *w, ++i; msleep(50); } - } while ((i < DA7219_SRM_CHECK_RETRIES) & (!srm_lock)); + } while ((i < DA7219_SRM_CHECK_RETRIES) && (!srm_lock));
if (!srm_lock) dev_warn(codec->dev, "SRM failed to lock\n");
Mark,
On Sep 27 2016 07:45, Takashi Sakamoto wrote:
Sparse reports a below warning.
sound/soc/codecs/da7219.c:804:57: warning: dubious: x & !y
The line includes a condition statement; '(a < b) & !c'. Practically, the evaluated value of this statement equals to the value of '(a < b) && !c'. Although, it's not an usual way to use bitwise operations as logical operations to several conditions.
This commit fixes the bug.
Fixes: 6d817c0e9fd7 ("ASoC: codecs: Add da7219 codec driver") Acked-by: Adam Thomson Adam.Thomson.Opensource@diasemi.com Cc: Support Opensource support.opensource@diasemi.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp
sound/soc/codecs/da7219.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index 50ea943..b9fa8fe 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -801,7 +801,7 @@ static int da7219_dai_event(struct snd_soc_dapm_widget *w, ++i; msleep(50); }
} while ((i < DA7219_SRM_CHECK_RETRIES) & (!srm_lock));
} while ((i < DA7219_SRM_CHECK_RETRIES) && (!srm_lock));
if (!srm_lock) dev_warn(codec->dev, "SRM failed to lock\n");
I have never received your 'applied' message to this patch, while received the others.
This patch should be abandoned? or I should send v2 with corrected subject line?
Regards
Takashi Sakamoto
On Wed, Sep 28, 2016 at 09:38:31AM +0900, Takashi Sakamoto wrote:
I have never received your 'applied' message to this patch, while received the others.
This patch should be abandoned? or I should send v2 with corrected subject line?
Please allow a reasonable time for review and for other people to commment on your changes, this change was not so trivial as your other changes so I've allowed longer for review. You sent a series consisting of a bunch of unrelated changes, it's likely if you do that that some of them will get handled differently.
On Sep 29 2016 01:49, Mark Brown wrote:
On Wed, Sep 28, 2016 at 09:38:31AM +0900, Takashi Sakamoto wrote:
I have never received your 'applied' message to this patch, while received the others.
This patch should be abandoned? or I should send v2 with corrected subject line?
Please allow a reasonable time for review and for other people to commment on your changes, this change was not so trivial as your other changes so I've allowed longer for review. You sent a series consisting of a bunch of unrelated changes, it's likely if you do that that some of them will get handled differently.
Hm. Your way to apply submitted patches is different from the others, at least, Iwai-san, Jaroslav and Greg. They rarely apply a part of patches in a patchset. I'm puzzled again for this sub-sub-system, ASoC.
Anyway, thanks.
Takashi Sakamoto
Sparse reports below warnings.
bxt_rt298.c:275:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:290:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:304:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:317:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:331:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:344:9: warning: obsolete array initializer, use C99 syntax bxt_rt298.c:357:9: warning: obsolete array initializer, use C99 syntax
There's no need to use obsoleted way. This commit fixes it.
Fixes: 76016322ec56 ("ASoC: Intel: Add Broxton-P machine driver") Acked-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/soc/intel/boards/bxt_rt298.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 253d7bf..d610bdc 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -271,7 +271,7 @@ static const struct snd_soc_ops broxton_rt286_fe_ops = { /* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = { /* Front End DAI links */ - [BXT_DPCM_AUDIO_PB] + [BXT_DPCM_AUDIO_PB] = { .name = "Bxt Audio Port", .stream_name = "Audio", @@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .dpcm_playback = 1, .ops = &broxton_rt286_fe_ops, }, - [BXT_DPCM_AUDIO_CP] + [BXT_DPCM_AUDIO_CP] = { .name = "Bxt Audio Capture Port", .stream_name = "Audio Record", @@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .dpcm_capture = 1, .ops = &broxton_rt286_fe_ops, }, - [BXT_DPCM_AUDIO_REF_CP] + [BXT_DPCM_AUDIO_REF_CP] = { .name = "Bxt Audio Reference cap", .stream_name = "refcap", @@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_DMIC_CP] + [BXT_DPCM_AUDIO_DMIC_CP] = { .name = "Bxt Audio DMIC cap", .stream_name = "dmiccap", @@ -327,7 +327,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .dynamic = 1, .ops = &broxton_dmic_ops, }, - [BXT_DPCM_AUDIO_HDMI1_PB] + [BXT_DPCM_AUDIO_HDMI1_PB] = { .name = "Bxt HDMI Port1", .stream_name = "Hdmi1", @@ -340,7 +340,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI2_PB] + [BXT_DPCM_AUDIO_HDMI2_PB] = { .name = "Bxt HDMI Port2", .stream_name = "Hdmi2", @@ -353,7 +353,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI3_PB] + [BXT_DPCM_AUDIO_HDMI3_PB] = { .name = "Bxt HDMI Port3", .stream_name = "Hdmi3",
Sparse reports below warnings.
bxt_da7219_max98357a.c:250:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:275:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:290:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:304:9: warning: obsolete array initializer, use C99 syntax bxt_da7219_max98357a.c:317:9: warning: obsolete array initializer, use C99 syntax
There's no need to use obsoleted way. This commit fixes it.
Fixes: 723bad3fef8b ("ASoC: Intel: Add Broxton-P Dialog Maxim machine driver") Acked-by: Vinod Koul vinod.koul@intel.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 3774b11..49b65d4 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -255,7 +255,7 @@ static struct snd_soc_ops broxton_da7219_ops = { /* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_dais[] = { /* Front End DAI links */ - [BXT_DPCM_AUDIO_PB] + [BXT_DPCM_AUDIO_PB] = { .name = "Bxt Audio Port", .stream_name = "Audio", @@ -271,7 +271,7 @@ static struct snd_soc_dai_link broxton_dais[] = { .dpcm_playback = 1, .ops = &broxton_da7219_fe_ops, }, - [BXT_DPCM_AUDIO_CP] + [BXT_DPCM_AUDIO_CP] = { .name = "Bxt Audio Capture Port", .stream_name = "Audio Record", @@ -286,7 +286,7 @@ static struct snd_soc_dai_link broxton_dais[] = { .dpcm_capture = 1, .ops = &broxton_da7219_fe_ops, }, - [BXT_DPCM_AUDIO_REF_CP] + [BXT_DPCM_AUDIO_REF_CP] = { .name = "Bxt Audio Reference cap", .stream_name = "Refcap", @@ -300,7 +300,7 @@ static struct snd_soc_dai_link broxton_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI1_PB] + [BXT_DPCM_AUDIO_HDMI1_PB] = { .name = "Bxt HDMI Port1", .stream_name = "Hdmi1", @@ -313,7 +313,7 @@ static struct snd_soc_dai_link broxton_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI2_PB] + [BXT_DPCM_AUDIO_HDMI2_PB] = { .name = "Bxt HDMI Port2", .stream_name = "Hdmi2", @@ -326,7 +326,7 @@ static struct snd_soc_dai_link broxton_dais[] = { .nonatomic = 1, .dynamic = 1, }, - [BXT_DPCM_AUDIO_HDMI3_PB] + [BXT_DPCM_AUDIO_HDMI3_PB] = { .name = "Bxt HDMI Port3", .stream_name = "Hdmi3",
Sparse reports below warnings.
rt5616.c:1270:24: warning: symbol 'rt5616_aif_dai_ops' was not declared. Should it be static? rt5616.c:1277:27: warning: symbol 'rt5616_dai' was not declared. Should it be static?
These two symbols are just used inner the file, thus it's better to add static qualifier.
This commit adds it.
Fixes: b1d15059957d ("ASoC: rt5616: add rt5616 codec driver") Cc: Bard Liao bardliao@realtek.com Cc: Oder Chiou oder_chiou@realtek.com Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/soc/codecs/rt5616.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/rt5616.c b/sound/soc/codecs/rt5616.c index f527b5b..98ae326 100644 --- a/sound/soc/codecs/rt5616.c +++ b/sound/soc/codecs/rt5616.c @@ -1267,14 +1267,14 @@ static int rt5616_resume(struct snd_soc_codec *codec) #define RT5616_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
-struct snd_soc_dai_ops rt5616_aif_dai_ops = { +static struct snd_soc_dai_ops rt5616_aif_dai_ops = { .hw_params = rt5616_hw_params, .set_fmt = rt5616_set_dai_fmt, .set_sysclk = rt5616_set_dai_sysclk, .set_pll = rt5616_set_dai_pll, };
-struct snd_soc_dai_driver rt5616_dai[] = { +static struct snd_soc_dai_driver rt5616_dai[] = { { .name = "rt5616-aif1", .id = RT5616_AIF1,
Sparse reports a below warning.
tpa6130a2.c:193:33: warning: symbol 'tpa6130a2_component_driver' was not declared. Should it be static?
The symbol is just used inner the file. Forthermore, it's constant. Thus, it's better to add static and const qualifier.
This commit adds it.
Fixes: cb7e62256e99 ("ASoC: tpa6130a2: Register component") Cc: Helen Koike helen.koike@collabora.co.uk Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp --- sound/soc/codecs/tpa6130a2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index f1ea052..47e63a1 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -190,7 +190,7 @@ static const struct snd_soc_dapm_route tpa6130a2_dapm_routes[] = { { "Right PGA", NULL, "Power" }, };
-struct snd_soc_component_driver tpa6130a2_component_driver = { +static const struct snd_soc_component_driver tpa6130a2_component_driver = { .name = "tpa6130a2", .probe = tpa6130a2_component_probe, .dapm_widgets = tpa6130a2_dapm_widgets,
The patch
ASOC: tpa6130a2: add static qualifier for file local symbols
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 3cadd224474d60ee06cebafc63db9cd5f8cc47f7 Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto o-takashi@sakamocchi.jp Date: Tue, 27 Sep 2016 07:45:11 +0900 Subject: [PATCH] ASOC: tpa6130a2: add static qualifier for file local symbols
Sparse reports a below warning.
tpa6130a2.c:193:33: warning: symbol 'tpa6130a2_component_driver' was not declared. Should it be static?
The symbol is just used inner the file. Forthermore, it's constant. Thus, it's better to add static and const qualifier.
This commit adds it.
Fixes: cb7e62256e99 (ASoC: tpa6130a2: Register component) Signed-off-by: Takashi Sakamoto o-takashi@sakamocchi.jp Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/tpa6130a2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c index 3712db0881d0..2e014c80d113 100644 --- a/sound/soc/codecs/tpa6130a2.c +++ b/sound/soc/codecs/tpa6130a2.c @@ -199,7 +199,7 @@ static const struct snd_soc_dapm_route tpa6130a2_dapm_routes[] = { { "Right PGA", NULL, "Power" }, };
-struct snd_soc_component_driver tpa6130a2_component_driver = { +static const struct snd_soc_component_driver tpa6130a2_component_driver = { .name = "tpa6130a2", .probe = tpa6130a2_component_probe, .dapm_widgets = tpa6130a2_dapm_widgets,
On Tue, Sep 27, 2016 at 07:45:06AM +0900, Takashi Sakamoto wrote:
Hi,
This patchset updates my previous one, and for Linux 4.8-rc8. http://mailman.alsa-project.org/pipermail/alsa-devel/2016-July/110466.html
Please use subject lines matching the style for the subsystem. This makes it easier for people to identify relevant patches.
participants (2)
-
Mark Brown
-
Takashi Sakamoto