linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning
@ 2021-06-21 13:45 Srinivas Kandagatla
  2021-06-21 13:45 ` [PATCH 2/2] ASoC: codecs: wcd938x: fix uninitialized symbol warnings Srinivas Kandagatla
  2021-06-22 15:14 ` [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2021-06-21 13:45 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, linux-kernel, lgirdwood, Srinivas Kandagatla,
	kernel test robot

This patch fixes below

	warning: unused variable wcd938x_dt_match

by placing device match table under CONFIG_OF

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wcd938x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 4be61122b0b5..427f51fade37 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -3714,12 +3714,14 @@ static int wcd938x_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#if defined(CONFIG_OF)
 static const struct of_device_id wcd938x_dt_match[] = {
 	{ .compatible = "qcom,wcd9380-codec" },
 	{ .compatible = "qcom,wcd9385-codec" },
 	{}
 };
 MODULE_DEVICE_TABLE(of, wcd938x_dt_match);
+#endif
 
 static struct platform_driver wcd938x_codec_driver = {
 	.probe = wcd938x_probe,
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: codecs: wcd938x: fix uninitialized symbol warnings
  2021-06-21 13:45 [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Srinivas Kandagatla
@ 2021-06-21 13:45 ` Srinivas Kandagatla
  2021-06-22 15:14 ` [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2021-06-21 13:45 UTC (permalink / raw)
  To: broonie
  Cc: alsa-devel, linux-kernel, lgirdwood, Srinivas Kandagatla, Dan Carpenter

This patch fixes below two uninitialized symbol warnings

warning:
	sound/soc/codecs/wcd938x.c:2092 wcd938x_tx_swr_ctrl()
	error: uninitialized symbol 'rate'

	sound/soc/codecs/wcd938x.c:2189 wcd938x_tx_channel_config()
	error: uninitialized symbol 'reg'.

First one my brining in check to already existing if condition and
second one by adding a default switch case to avoid any access to reg.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wcd938x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index 427f51fade37..11315262391e 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -2086,11 +2086,9 @@ static int wcd938x_tx_swr_ctrl(struct snd_soc_dapm_widget *w,
 			}
 			rate = wcd938x_get_clk_rate(i);
 			wcd938x_set_swr_clk_rate(component, rate, bank);
-		}
-
-		if (strnstr(w->name, "ADC", sizeof("ADC")))
 			/* Copy clk settings to active bank */
 			wcd938x_set_swr_clk_rate(component, rate, !bank);
+		}
 		break;
 	case SND_SOC_DAPM_POST_PMD:
 		if (strnstr(w->name, "ADC", sizeof("ADC"))) {
@@ -2185,6 +2183,8 @@ static void wcd938x_tx_channel_config(struct snd_soc_component *component,
 		reg = WCD938X_ANA_TX_CH4;
 		mask = WCD938X_HPF4_INIT_MASK;
 		break;
+	default:
+		return;
 	}
 
 	snd_soc_component_write_field(component, reg, mask, mode);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning
  2021-06-21 13:45 [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Srinivas Kandagatla
  2021-06-21 13:45 ` [PATCH 2/2] ASoC: codecs: wcd938x: fix uninitialized symbol warnings Srinivas Kandagatla
@ 2021-06-22 15:14 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-06-22 15:14 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Mark Brown, kernel test robot, alsa-devel, linux-kernel, lgirdwood

On Mon, 21 Jun 2021 14:45:01 +0100, Srinivas Kandagatla wrote:
> This patch fixes below
> 
> 	warning: unused variable wcd938x_dt_match
> 
> by placing device match table under CONFIG_OF

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: codecs: wcd938x: fix unused variable warning
      commit: 8c4863c261c812a1088b0f8c6b66386d885390e1
[2/2] ASoC: codecs: wcd938x: fix uninitialized symbol warnings
      commit: d245fff1013cb7456ea9ca3f7b858e438c6bbf79

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-22 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 13:45 [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Srinivas Kandagatla
2021-06-21 13:45 ` [PATCH 2/2] ASoC: codecs: wcd938x: fix uninitialized symbol warnings Srinivas Kandagatla
2021-06-22 15:14 ` [PATCH 1/2] ASoC: codecs: wcd938x: fix unused variable warning Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).