Skip to contentSkip to conversation

ASoC: Compile fixes with W=1

PATCH In review Vinod Koul 4 participants 26 messages Dec 8, 2016 – Dec 15, 2016

Subsystems (7)
lore
Share & tools
lore

Vinod Koul

author
#0 lore raw

cover ASoC: Compile fixes with W=1

We seem to have few warnings in ASoC (I have tried only one config today) when we compile with W=1. So this is first set to fix these warning, which predominantly are unused but initialized variables. Few instances actually helped remove a bit more code as well.

Vinod Koul (14):
ASoC: Intel: Skylake: remove unused 'ret'
ASoC: Intel: sst: remove unused 'msg_high'
ASoC: Intel: sst: remove unused 'ops'
ASoC: topology: remove unused 'err'
ASoC: hdac_hdmi: remove unused 'dai_map'
ASoC: max98090: remove superflous check for 'micbias'
ASoC: AMD: remove unused ‘dma_buffer’
ASoC: adau17x1: remove unused ‘ret’
ASoC: max9867: remove unused ‘ret’
ASoC: pcm3168a: remove unused ‘format’
ASoC: img: remove unused ‘format’
ASoC: Intel: sst: remove unused ‘ret_val’
ASoC: samsung: smdk_wm8580: remove unused ‘bfs’
ASoC: zx296702-i2s: remove unused ‘format’

 sound/soc/amd/acp-pcm-dma.c                  | 3 ---
 sound/soc/codecs/adau17x1.c                  | 3 +--
 sound/soc/codecs/hdac_hdmi.c                 | 5 -----
 sound/soc/codecs/max98090.c                  | 2 +-
 sound/soc/codecs/max9867.c                   | 5 ++---
 sound/soc/codecs/pcm3168a.c                  | 2 --
 sound/soc/img/img-parallel-out.c             | 2 --
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 4 ++--
 sound/soc/intel/atom/sst/sst_ipc.c           | 2 --
 sound/soc/intel/atom/sst/sst_stream.c        | 2 --
 sound/soc/intel/skylake/skl-topology.c       | 3 +--
 sound/soc/samsung/smdk_wm8580.c              | 5 +----
 sound/soc/soc-topology.c                     | 4 ++--
 sound/soc/zte/zx296702-i2s.c                 | 5 +----
 14 files changed, 11 insertions(+), 36 deletions(-)
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#1 lore raw

PATCH 1/14 ASoC: Intel: Skylake: remove unused 'ret'

In skl_tplg_mixer_dapm_post_pmd_event(), a variable 'ret' is initialized but not used.

We don't check return of skl_delete_pipe, so remove the assignment as well, so remove this variable.

sound/soc/intel/skylake/skl-topology.c: In function ‘skl_tplg_mixer_dapm_post_pmd_event’:
sound/soc/intel/skylake/skl-topology.c:976:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

  int ret = 0;
      ^
---
 sound/soc/intel/skylake/skl-topology.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/intel/skylake/skl-topology.c +1 -2
index 4352236af21a..04fddc110d3f 100644
@@ -973,7 +973,6 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 	struct skl_module_cfg *src_module = NULL, *dst_module;
 	struct skl_sst *ctx = skl->skl_sst;
 	struct skl_pipe *s_pipe = mconfig->pipe;
-	int ret = 0;
 
 	if (s_pipe->state == SKL_PIPE_INVALID)
 		return -EINVAL;
@@ -995,7 +994,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 		src_module = dst_module;
 	}
 
-	ret = skl_delete_pipe(ctx, mconfig->pipe);
+	skl_delete_pipe(ctx, mconfig->pipe);
 
 	return skl_tplg_unload_pipe_modules(ctx, s_pipe);
 }
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#2 lore raw

Applied "ASoC: Intel: Skylake: remove unused 'ret'" to the asoc tree

The patch

ASoC: Intel: Skylake: remove unused 'ret'

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 547cafa3efc3f12101cafd454e651c9a5a8feae4 Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:24 +0530
Subject: [PATCH] ASoC: Intel: Skylake: remove unused 'ret'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In skl_tplg_mixer_dapm_post_pmd_event(), a variable 'ret' is initialized but not used.

We don't check return of skl_delete_pipe, so remove the assignment as well, so remove this variable.

sound/soc/intel/skylake/skl-topology.c: In function ‘skl_tplg_mixer_dapm_post_pmd_event’:
sound/soc/intel/skylake/skl-topology.c:976:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

  int ret = 0;
      ^
---
 sound/soc/intel/skylake/skl-topology.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/intel/skylake/skl-topology.c +1 -2
index bd313c907b20..eb440cd9a2a4 100644
@@ -974,7 +974,6 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 	struct skl_module_cfg *src_module = NULL, *dst_module;
 	struct skl_sst *ctx = skl->skl_sst;
 	struct skl_pipe *s_pipe = mconfig->pipe;
-	int ret = 0;
 
 	if (s_pipe->state == SKL_PIPE_INVALID)
 		return -EINVAL;
@@ -996,7 +995,7 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,
 		src_module = dst_module;
 	}
 
-	ret = skl_delete_pipe(ctx, mconfig->pipe);
+	skl_delete_pipe(ctx, mconfig->pipe);
 
 	return skl_tplg_unload_pipe_modules(ctx, s_pipe);
 }
Signature · 1 line
2.11.0
author
#3 lore raw

PATCH 2/14 ASoC: Intel: sst: remove unused 'msg_high'

In reply to Vinod Koul

In process_fw_async_msg(), a variable 'msg_high' is initialized but not used. So remove it.

sound/soc/intel/atom/sst/sst_ipc.c: In function ‘process_fw_async_msg’:
sound/soc/intel/atom/sst/sst_ipc.c:263:24: warning: variable ‘msg_high’ set but not used [-Wunused-but-set-variable]
union ipc_header_high msg_high;

---
 sound/soc/intel/atom/sst/sst_ipc.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_ipc.c +0 -2
index 374bb61c596d..14c2d9d18180 100644
@@ -260,10 +260,8 @@ static void process_fw_async_msg(struct intel_sst_drv *sst_drv_ctx,
 	u32 data_size, i;
 	void *data_offset;
 	struct stream_info *stream;
-	union ipc_header_high msg_high;
 	u32 msg_low, pipe_id;
 
-	msg_high = msg->mrfld_header.p.header_high;
 	msg_low = msg->mrfld_header.p.header_low_payload;
 	msg_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->cmd_id;
 	data_offset = (msg->mailbox_data + sizeof(struct ipc_dsp_hdr));
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#4 lore raw

Applied "ASoC: Intel: sst: remove unused 'msg_high'" to the asoc tree

The patch

ASoC: Intel: sst: remove unused 'msg_high'

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 ee9292e859bec2bd8b79b7d14bc352e9ea5d7257 Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:25 +0530
Subject: [PATCH] ASoC: Intel: sst: remove unused 'msg_high'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In process_fw_async_msg(), a variable 'msg_high' is initialized but not used. So remove it.

sound/soc/intel/atom/sst/sst_ipc.c: In function ‘process_fw_async_msg’:
sound/soc/intel/atom/sst/sst_ipc.c:263:24: warning: variable ‘msg_high’ set but not used [-Wunused-but-set-variable]
union ipc_header_high msg_high;

---
 sound/soc/intel/atom/sst/sst_ipc.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_ipc.c +0 -2
index 374bb61c596d..14c2d9d18180 100644
@@ -260,10 +260,8 @@ static void process_fw_async_msg(struct intel_sst_drv *sst_drv_ctx,
 	u32 data_size, i;
 	void *data_offset;
 	struct stream_info *stream;
-	union ipc_header_high msg_high;
 	u32 msg_low, pipe_id;
 
-	msg_high = msg->mrfld_header.p.header_high;
 	msg_low = msg->mrfld_header.p.header_low_payload;
 	msg_id = ((struct ipc_dsp_hdr *)msg->mailbox_data)->cmd_id;
 	data_offset = (msg->mailbox_data + sizeof(struct ipc_dsp_hdr));
Signature · 1 line
2.11.0
author
#5 lore raw

PATCH 3/14 ASoC: Intel: sst: remove unused 'ops'

In reply to Vinod Koul

In sst_free_stream(), a variable 'ops' is initialized but not used. So remove it.

sound/soc/intel/atom/sst/sst_stream.c: In function ‘sst_free_stream’:
sound/soc/intel/atom/sst/sst_stream.c:397:24: warning: variable ‘ops’ set but not used [-Wunused-but-set-variable]
struct intel_sst_ops *ops;

---
 sound/soc/intel/atom/sst/sst_stream.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_stream.c +0 -2
index 51bdeeecb7c8..83d8dda15233 100644
@@ -394,7 +394,6 @@ int sst_free_stream(struct intel_sst_drv *sst_drv_ctx, int str_id)
 {
 	int retval = 0;
 	struct stream_info *str_info;
-	struct intel_sst_ops *ops;
 
 	dev_dbg(sst_drv_ctx->dev, "SST DBG:sst_free_stream for %d\n", str_id);
 
@@ -407,7 +406,6 @@ int sst_free_stream(struct intel_sst_drv *sst_drv_ctx, int str_id)
 	str_info = get_stream_info(sst_drv_ctx, str_id);
 	if (!str_info)
 		return -EINVAL;
-	ops = sst_drv_ctx->ops;
 
 	mutex_lock(&str_info->lock);
 	if (str_info->status != STREAM_UN_INIT) {
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#6 lore raw

Applied "ASoC: Intel: sst: remove unused 'ops'" to the asoc tree

The patch

ASoC: Intel: sst: remove unused 'ops'

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 cf90c8245bb0d528a8046b4bfa4f223320c9dbb0 Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:26 +0530
Subject: [PATCH] ASoC: Intel: sst: remove unused 'ops'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In sst_free_stream(), a variable 'ops' is initialized but not used. So remove it.

sound/soc/intel/atom/sst/sst_stream.c: In function ‘sst_free_stream’:
sound/soc/intel/atom/sst/sst_stream.c:397:24: warning: variable ‘ops’ set but not used [-Wunused-but-set-variable]
struct intel_sst_ops *ops;

---
 sound/soc/intel/atom/sst/sst_stream.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/intel/atom/sst/sst_stream.c +0 -2
index 51bdeeecb7c8..83d8dda15233 100644
@@ -394,7 +394,6 @@ int sst_free_stream(struct intel_sst_drv *sst_drv_ctx, int str_id)
 {
 	int retval = 0;
 	struct stream_info *str_info;
-	struct intel_sst_ops *ops;
 
 	dev_dbg(sst_drv_ctx->dev, "SST DBG:sst_free_stream for %d\n", str_id);
 
@@ -407,7 +406,6 @@ int sst_free_stream(struct intel_sst_drv *sst_drv_ctx, int str_id)
 	str_info = get_stream_info(sst_drv_ctx, str_id);
 	if (!str_info)
 		return -EINVAL;
-	ops = sst_drv_ctx->ops;
 
 	mutex_lock(&str_info->lock);
 	if (str_info->status != STREAM_UN_INIT) {
Signature · 1 line
2.11.0
author
#7 lore raw

PATCH 4/14 ASoC: topology: remove unused 'err'

In reply to Vinod Koul

In soc_tplg_pcm_elems_load, a variable 'err' is initialized but not used.

It is assigned return values for pcm_new_ver() but never checked, so remove it.

sound/soc/soc-topology.c: In function ‘soc_tplg_pcm_elems_load’:
sound/soc/soc-topology.c:1865:9: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int i, err;

---
 sound/soc/soc-topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +2 -2
index 11feb19e9730..890cf84515a9 100644
@@ -1862,7 +1862,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
 {
 	struct snd_soc_tplg_pcm *pcm, *_pcm;
 	int count = hdr->count;
-	int i, err;
+	int i;
 	bool abi_match;
 
 	if (tplg->pass != SOC_TPLG_PASS_PCM_DAI)
@@ -1896,7 +1896,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
 			_pcm = pcm;
 		} else {
 			abi_match = false;
-			err = pcm_new_ver(tplg, pcm, &_pcm);
+			pcm_new_ver(tplg, pcm, &_pcm);
 		}
 
 		/* create the FE DAIs and DAI links */
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#8 lore raw

Applied "ASoC: topology: remove unused 'err'" to the asoc tree

The patch

ASoC: topology: remove unused 'err'

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 fd34045567991dc77a50163c5d0e465b423df962 Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:27 +0530
Subject: [PATCH] ASoC: topology: remove unused 'err'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In soc_tplg_pcm_elems_load, a variable 'err' is initialized but not used.

It is assigned return values for pcm_new_ver() but never checked, so remove it.

sound/soc/soc-topology.c: In function ‘soc_tplg_pcm_elems_load’:
sound/soc/soc-topology.c:1865:9: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
int i, err;

---
 sound/soc/soc-topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +2 -2
index 65670b2b408c..585b88b45f7b 100644
@@ -1863,7 +1863,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
 {
 	struct snd_soc_tplg_pcm *pcm, *_pcm;
 	int count = hdr->count;
-	int i, err;
+	int i;
 	bool abi_match;
 
 	if (tplg->pass != SOC_TPLG_PASS_PCM_DAI)
@@ -1897,7 +1897,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
 			_pcm = pcm;
 		} else {
 			abi_match = false;
-			err = pcm_new_ver(tplg, pcm, &_pcm);
+			pcm_new_ver(tplg, pcm, &_pcm);
 		}
 
 		/* create the FE DAIs and DAI links */
Signature · 1 line
2.11.0
author
#9 lore raw

PATCH 5/14 ASoC: hdac_hdmi: remove unused 'dai_map'

In reply to Vinod Koul

In hdac_hdmi_playback_cleanup(), a variable 'dai_map' is initialized but not used. Also while removing this two mare variables 'edev' and 'hdmi' become unused, so remove all these as well.

sound/soc/codecs/hdac_hdmi.c: In function ‘hdac_hdmi_playback_cleanup’:
sound/soc/codecs/hdac_hdmi.c:470:32: warning: variable ‘dai_map’ set but not used [-Wunused-but-set-variable]
struct hdac_hdmi_dai_pin_map *dai_map;

---
 sound/soc/codecs/hdac_hdmi.c | 5 -----
 1 file changed, 5 deletions(-)
sound/soc/codecs/hdac_hdmi.c +0 -5
index c602c4960924..793bc853ddef 100644
@@ -464,12 +464,7 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *dai)
 {
-	struct hdac_ext_device *edev = snd_soc_dai_get_drvdata(dai);
 	struct hdac_ext_dma_params *dd;
-	struct hdac_hdmi_priv *hdmi = edev->private_data;
-	struct hdac_hdmi_dai_pin_map *dai_map;
-
-	dai_map = &hdmi->dai_map[dai->id];
 
 	dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream);
 
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#10 lore raw

Applied "ASoC: hdac_hdmi: remove unused 'dai_map'" to the asoc tree

The patch

ASoC: hdac_hdmi: remove unused 'dai_map'

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 d56923da8f92dee0b557d3a8d6a3639deec35637 Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:28 +0530
Subject: [PATCH] ASoC: hdac_hdmi: remove unused 'dai_map'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In hdac_hdmi_playback_cleanup(), a variable 'dai_map' is initialized but not used. Also while removing this two mare variables 'edev' and 'hdmi' become unused, so remove all these as well.

sound/soc/codecs/hdac_hdmi.c: In function ‘hdac_hdmi_playback_cleanup’:
sound/soc/codecs/hdac_hdmi.c:470:32: warning: variable ‘dai_map’ set but not used [-Wunused-but-set-variable]
struct hdac_hdmi_dai_pin_map *dai_map;

---
 sound/soc/codecs/hdac_hdmi.c | 5 -----
 1 file changed, 5 deletions(-)
sound/soc/codecs/hdac_hdmi.c +0 -5
index c602c4960924..793bc853ddef 100644
@@ -464,12 +464,7 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream,
 static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *dai)
 {
-	struct hdac_ext_device *edev = snd_soc_dai_get_drvdata(dai);
 	struct hdac_ext_dma_params *dd;
-	struct hdac_hdmi_priv *hdmi = edev->private_data;
-	struct hdac_hdmi_dai_pin_map *dai_map;
-
-	dai_map = &hdmi->dai_map[dai->id];
 
 	dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream);
 
Signature · 1 line
2.11.0
author
#11 lore raw

PATCH 6/14 ASoC: max98090: remove superflous check for 'micbias'

In reply to Vinod Koul

In max98090_probe(), code checks for micbias being out of range. The 'micbias' variable in unsigned and checked against M98090_MBVSEL_2V2 which is zero, so remove this check.

sound/soc/codecs/max98090.c: In function ‘max98090_probe’:
sound/soc/codecs/max98090.c:2459:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
} else if (micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8) {

---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98090.c +1 -1
index 584aab83e478..66828480d484 100644
@@ -2456,7 +2456,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	if (err) {
 		micbias = M98090_MBVSEL_2V8;
 		dev_info(codec->dev, "use default 2.8v micbias\n");
-	} else if (micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8) {
+	} else if (micbias > M98090_MBVSEL_2V8) {
 		dev_err(codec->dev, "micbias out of range 0x%x\n", micbias);
 		micbias = M98090_MBVSEL_2V8;
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
maintainer
#12 lore raw

Applied "ASoC: max98090: remove superflous check for 'micbias'" to the asoc tree

The patch

ASoC: max98090: remove superflous check for 'micbias'

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 1c445a42c48754bb5f821478517ef1b9f861217a Mon Sep 17 00:00:00 2001

From: Vinod Koul <[email protected]>
Date: Thu, 8 Dec 2016 23:01:29 +0530
Subject: [PATCH] ASoC: max98090: remove superflous check for 'micbias'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In max98090_probe(), code checks for micbias being out of range. The 'micbias' variable in unsigned and checked against M98090_MBVSEL_2V2 which is zero, so remove this check.

sound/soc/codecs/max98090.c: In function ‘max98090_probe’:
sound/soc/codecs/max98090.c:2459:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
} else if (micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8) {

---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98090.c +1 -1
index 584aab83e478..66828480d484 100644
@@ -2456,7 +2456,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	if (err) {
 		micbias = M98090_MBVSEL_2V8;
 		dev_info(codec->dev, "use default 2.8v micbias\n");
-	} else if (micbias < M98090_MBVSEL_2V2 || micbias > M98090_MBVSEL_2V8) {
+	} else if (micbias > M98090_MBVSEL_2V8) {
 		dev_err(codec->dev, "micbias out of range 0x%x\n", micbias);
 		micbias = M98090_MBVSEL_2V8;
 	}
Signature · 1 line
2.11.0
author
#13 lore raw

PATCH 7/14 ASoC: AMD: remove unused ‘dma_buffer’

In reply to Vinod Koul

In acp_dma_hw_params(), 'dma_buffer' is initialized, but not used. So remove it.

sound/soc/amd/acp-pcm-dma.c: In function ‘acp_dma_hw_params’:
sound/soc/amd/acp-pcm-dma.c:673:25: warning: variable ‘dma_buffer’ set but not used [-Wunused-but-set-variable]
struct snd_dma_buffer *dma_buffer;

Cc Maruthi Bayyavarapu <[email protected]>
---
 sound/soc/amd/acp-pcm-dma.c | 3 ---
 1 file changed, 3 deletions(-)
sound/soc/amd/acp-pcm-dma.c +0 -3
index 504c7cd7f58a..818b052377f3 100644
@@ -670,13 +670,10 @@ static int acp_dma_hw_params(struct snd_pcm_substream *substream,
 {
 	int status;
 	uint64_t size;
-	struct snd_dma_buffer *dma_buffer;
 	struct page *pg;
 	struct snd_pcm_runtime *runtime;
 	struct audio_substream_data *rtd;
 
-	dma_buffer = &substream->dma_buffer;
-
 	runtime = substream->runtime;
 	rtd = runtime->private_data;
 
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#14 lore raw

PATCH 8/14 ASoC: adau17x1: remove unused ‘ret’

In reply to Vinod Koul

In adau17x1_pll_event(), 'ret' is initialized as return value of regmap_raw_write() but never checked, so remove this and assignement.

sound/soc/codecs/adau17x1.c: In function ‘adau17x1_pll_event’:
sound/soc/codecs/adau17x1.c:68:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret;

Cc Lars-Peter Clausen <[email protected]>
---
 sound/soc/codecs/adau17x1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/adau17x1.c +1 -2
index b36511d965c8..2c1bd2763864 100644
@@ -65,7 +65,6 @@ static int adau17x1_pll_event(struct snd_soc_dapm_widget *w,
 {
 	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
 	struct adau *adau = snd_soc_codec_get_drvdata(codec);
-	int ret;
 
 	if (SND_SOC_DAPM_EVENT_ON(event)) {
 		adau->pll_regs[5] = 1;
@@ -78,7 +77,7 @@ static int adau17x1_pll_event(struct snd_soc_dapm_widget *w,
 	}
 
 	/* The PLL register is 6 bytes long and can only be written at once. */
-	ret = regmap_raw_write(adau->regmap, ADAU17X1_PLL_CONTROL,
+	regmap_raw_write(adau->regmap, ADAU17X1_PLL_CONTROL,
 			adau->pll_regs, ARRAY_SIZE(adau->pll_regs));
 
 	if (SND_SOC_DAPM_EVENT_ON(event)) {
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#15 lore raw

PATCH 9/14 ASoC: max9867: remove unused ‘ret’

In reply to Vinod Koul

In max9867_dai_set_fmt(), 'ret' is initialized as return value of regmap_raw_write() but never checked, so remove this and assignement.

sound/soc/codecs/max9867.c: In function ‘max9867_dai_set_fmt’:
sound/soc/codecs/max9867.c:312:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret;

---
 sound/soc/codecs/max9867.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
sound/soc/codecs/max9867.c +2 -3
index 42e2e407e287..6cdf15ab46de 100644
@@ -309,7 +309,6 @@ static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai,
 	struct snd_soc_codec *codec = codec_dai->codec;
 	struct max9867_priv *max9867 = snd_soc_codec_get_drvdata(codec);
 	u8 iface1A = 0, iface1B = 0;
-	int ret;
 
 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
 	case SND_SOC_DAIFMT_CBM_CFM:
@@ -346,8 +345,8 @@ static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai,
 		return -EINVAL;
 	}
 
-	ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
-	ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
+	regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
+	regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
 	return 0;
 }
 
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#16 lore raw

Re: [PATCH 09/14] ASoC: max9867: remove unused ‘ret’

sound/soc/codecs/max9867.c static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai, · line 349

Quoted 4 lines · Vinod Koul
sound/soc/codecs/max9867.c +2 -2
-       ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
-       ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
+       regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
+       regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);

What about doing like this instead?

ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A); if (ret)

    return ret;

ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B); if (ret)
return ret;

return 0;

author
#17 lore raw

Re: [PATCH 09/14] ASoC: max9867: remove unused ‘ret’

Quoted 9 lines · Fabio Estevam

sound/soc/codecs/max9867.c static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai, · line 349

Quoted 4 lines · Vinod Koul
sound/soc/codecs/max9867.c +2 -2
-       ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
-       ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);
+       regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A);
+       regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B);

What about doing like this instead?

Quoted 7 lines

ret = regmap_write(max9867->regmap, MAX9867_IFC1A, iface1A); if (ret)

    return ret;

ret = regmap_write(max9867->regmap, MAX9867_IFC1B, iface1B); if (ret)
return ret;

yeah we can, but I didn't want to add/remove anything from this code, so skipped the return which has same effect as previous code.

Btw should regmap_write() return be strictly checked or not?

Thanks

Signature · 1 line
~Vinod
maintainer
#18 lore raw

Re: [PATCH 09/14] ASoC: max9867: remove unused ‘ret’

Quoted 1 line · Vinod Koul

Btw should regmap_write() return be strictly checked or not?

Ideally but it's a lot of work and very rarely fails in practice so...

author
#19 lore raw

PATCH 10/14 ASoC: pcm3168a: remove unused ‘format’

In reply to Vinod Koul

In pcm3168a_hw_params(), 'format' is initialized but never used.

sound/soc/codecs/pcm3168a.c: In function ‘pcm3168a_hw_params’:
sound/soc/codecs/pcm3168a.c:405:19: warning: variable ‘format’ set but not used [-Wunused-but-set-variable]
snd_pcm_format_t format;

Cc Damien.Horsley <[email protected]>
---
 sound/soc/codecs/pcm3168a.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/codecs/pcm3168a.c +0 -2
index 39bc02d5bc5d..b9d1207ccef2 100644
@@ -402,10 +402,8 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
 	u32 val, mask, shift, reg;
 	unsigned int rate, fmt, ratio, max_ratio;
 	int i, min_frame_size;
-	snd_pcm_format_t format;
 
 	rate = params_rate(params);
-	format = params_format(params);
 
 	ratio = pcm3168a->sysclk / rate;
 
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#20 lore raw

PATCH 11/14 ASoC: img: remove unused ‘format’

In reply to Vinod Koul

In img_prl_out_hw_params(), 'format' is initialized but never used. So remove it.

sound/soc/img/img-parallel-out.c: In function ‘img_prl_out_hw_params’:
sound/soc/img/img-parallel-out.c:126:19: warning: variable ‘format’ set but not used [-Wunused-but-set-variable]
snd_pcm_format_t format;

Cc Damien.Horsley <[email protected]>
---
 sound/soc/img/img-parallel-out.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/img/img-parallel-out.c +0 -2
index c1610a054d65..33ceb207ee70 100644
@@ -123,10 +123,8 @@ static int img_prl_out_hw_params(struct snd_pcm_substream *substream,
 	struct img_prl_out *prl = snd_soc_dai_get_drvdata(dai);
 	unsigned int rate, channels;
 	u32 reg, control_set = 0;
-	snd_pcm_format_t format;
 
 	rate = params_rate(params);
-	format = params_format(params);
 	channels = params_channels(params);
 
 	switch (params_format(params)) {
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#21 lore raw

PATCH 12/14 ASoC: Intel: sst: remove unused ‘ret_val’

In reply to Vinod Koul

In sst_media_close(), 'ret_val' is initialized and assigned as return value of stream ops close but never used. So remove it.

ound/soc/intel/atom/sst-mfld-platform-pcm.c: In function ‘sst_media_close’:
sound/soc/intel/atom/sst-mfld-platform-pcm.c:360:6: warning: variable ‘ret_val’ set but not used [-Wunused-but-set-variable]
int ret_val = 0, str_id;

---
 sound/soc/intel/atom/sst-mfld-platform-pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/intel/atom/sst-mfld-platform-pcm.c +2 -2
index f5a8050351b5..0fd7848fbe4a 100644
@@ -357,14 +357,14 @@ static void sst_media_close(struct snd_pcm_substream *substream,
 		struct snd_soc_dai *dai)
 {
 	struct sst_runtime_stream *stream;
-	int ret_val = 0, str_id;
+	int str_id;
 
 	stream = substream->runtime->private_data;
 	power_down_sst(stream);
 
 	str_id = stream->stream_info.str_id;
 	if (str_id)
-		ret_val = stream->ops->close(sst->dev, str_id);
+		stream->ops->close(sst->dev, str_id);
 	module_put(sst->dev->driver->owner);
 	kfree(stream);
 }
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#22 lore raw

PATCH 13/14 ASoC: samsung: smdk_wm8580: remove unused ‘bfs’

In reply to Vinod Koul

In smdk_hw_params(), 'bfs' is initialized and assigned bits based on params_width, but never used.

We could have removed the whole switch case but then driver might be relying on checking bits, so I have kept the case for now.

sound/soc/samsung/smdk_wm8580.c: In function ‘smdk_hw_params’:
sound/soc/samsung/smdk_wm8580.c:35:6: warning: variable ‘bfs’ set but not used [-Wunused-but-set-variable]
int bfs, rfs, ret;

---
 sound/soc/samsung/smdk_wm8580.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/samsung/smdk_wm8580.c +1 -4
index de724ce7b955..6e4dfa7e2c89 100644
@@ -32,14 +32,11 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	unsigned int pll_out;
-	int bfs, rfs, ret;
+	int rfs, ret;
 
 	switch (params_width(params)) {
 	case 8:
-		bfs = 16;
-		break;
 	case 16:
-		bfs = 32;
 		break;
 	default:
 		return -EINVAL;
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
author
#23 lore raw

PATCH 14/14 ASoC: zx296702-i2s: remove unused ‘format’

In reply to Vinod Koul

In zx_i2s_hw_params(), 'format' is initialized and assigned bits based on params_format, but never used. So remove it.

sound/soc/zte/zx296702-i2s.c: In function ‘zx_i2s_hw_params’:
sound/soc/zte/zx296702-i2s.c:228:21: warning: variable ‘format’ set but not used [-Wunused-but-set-variable]
unsigned long val, format;

---
 sound/soc/zte/zx296702-i2s.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/zte/zx296702-i2s.c +1 -4
index 1cad93dc1fcf..ed7a56d1ef54 100644
@@ -225,7 +225,7 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
 	struct zx_i2s_info *i2s = snd_soc_dai_get_drvdata(socdai);
 	struct snd_dmaengine_dai_dma_data *dma_data;
 	unsigned int lane, ch_num, len, ret = 0;
-	unsigned long val, format;
+	unsigned long val;
 	unsigned long chn_cfg;
 
 	dma_data = snd_soc_dai_get_dma_data(socdai, substream);
@@ -238,15 +238,12 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
 
 	switch (params_format(params)) {
 	case SNDRV_PCM_FORMAT_S16_LE:
-		format = 0;
 		len = 16;
 		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
-		format = 1;
 		len = 24;
 		break;
 	case SNDRV_PCM_FORMAT_S32_LE:
-		format = 2;
 		len = 32;
 		break;
 	default:
Signature · 6 lines
1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Reviewed-by on v1 14/14
#24 lore raw

Re: [PATCH 14/14] ASoC: zx296702-i2s: remove unused ‘format’

2016-12-09 1:31 GMT+08:00 Vinod Koul <[email protected]>:

Quoted 43 lines

In zx_i2s_hw_params(), 'format' is initialized and assigned bits based on params_format, but never used. So remove it.

sound/soc/zte/zx296702-i2s.c: In function ‘zx_i2s_hw_params’:
sound/soc/zte/zx296702-i2s.c:228:21: warning: variable ‘format’ set but not used [-Wunused-but-set-variable]
unsigned long val, format;

---
 sound/soc/zte/zx296702-i2s.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/zte/zx296702-i2s.c +1 -5
index 1cad93dc1fcf..ed7a56d1ef54 100644
@@ -225,7 +225,7 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
        struct zx_i2s_info *i2s = snd_soc_dai_get_drvdata(socdai);
        struct snd_dmaengine_dai_dma_data *dma_data;
        unsigned int lane, ch_num, len, ret = 0;
-       unsigned long val, format;
+       unsigned long val;
        unsigned long chn_cfg;
 
        dma_data = snd_soc_dai_get_dma_data(socdai, substream);
@@ -238,15 +238,12 @@ static int zx_i2s_hw_params(struct snd_pcm_substream *substream,
 
        switch (params_format(params)) {
        case SNDRV_PCM_FORMAT_S16_LE:
-               format = 0;
                len = 16;
                break;
        case SNDRV_PCM_FORMAT_S24_LE:
-               format = 1;
                len = 24;
                break;
        case SNDRV_PCM_FORMAT_S32_LE:
-               format = 2;
                len = 32;
                break;
        default:
--
Quoted 2 lines

1.9.1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

maintainer
#25 lore raw

Re: [PATCH 14/14] ASoC: zx296702-i2s: remove unused ‘format’

Quoted 7 lines · Jun Nie

2016-12-09 1:31 GMT+08:00 Vinod Koul <[email protected]>:

Quoted 3 lines

--
1.9.1

Please delete unneeded context from mails when replying. Doing this makes it much easier to find your reply in the message, helping ensure it won't be missed by people scrolling through the irrelevant quoted material.