All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rt1015: remove possible unused variable `bclk_ms'
@ 2021-08-23 15:33 Tzung-Bi Shih
  2021-08-23 17:37 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Tzung-Bi Shih @ 2021-08-23 15:33 UTC (permalink / raw)
  To: broonie; +Cc: tzungbi, alsa-devel, kernel test robot

bclk_ms is possible unused by using the given config (see [1]).

sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is
never read [clang-analyzer-deadcode.DeadStores]
           bclk_ms = frame_size > 32;
           ^         ~~~~~~~~~~~~~~~

In addition, bclk_ms is meaningless and confusing after applying commit
a5db2ca51367 ("ASoC: rt1015: remove unneeded variables in rt1015_priv").
The "> 32" in the expression looks like a typo but it was not.

Let's remove the confusing variable bclk_ms.

[1]: https://lkml.org/lkml/2021/8/23/305

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
For the other two reported files: tas2770.c and wm8731.c, it seems
there is no straightforward way to fix the warning. 

 sound/soc/codecs/rt1015.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c
index b3e69bf245dd..c0c5952cdff7 100644
--- a/sound/soc/codecs/rt1015.c
+++ b/sound/soc/codecs/rt1015.c
@@ -689,7 +689,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
 {
 	struct snd_soc_component *component = dai->component;
 	struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component);
-	int pre_div, bclk_ms, frame_size, lrck;
+	int pre_div, frame_size, lrck;
 	unsigned int val_len = 0;
 
 	lrck = params_rate(params);
@@ -706,10 +706,7 @@ static int rt1015_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	}
 
-	bclk_ms = frame_size > 32;
-
-	dev_dbg(component->dev, "bclk_ms is %d and pre_div is %d for iis %d\n",
-				bclk_ms, pre_div, dai->id);
+	dev_dbg(component->dev, "pre_div is %d for iis %d\n", pre_div, dai->id);
 
 	dev_dbg(component->dev, "lrck is %dHz and pre_div is %d for iis %d\n",
 				lrck, pre_div, dai->id);
-- 
2.33.0.rc2.250.ged5fa647cd-goog


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

* Re: [PATCH] ASoC: rt1015: remove possible unused variable `bclk_ms'
  2021-08-23 15:33 [PATCH] ASoC: rt1015: remove possible unused variable `bclk_ms' Tzung-Bi Shih
@ 2021-08-23 17:37 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-08-23 17:37 UTC (permalink / raw)
  To: Tzung-Bi Shih; +Cc: alsa-devel, Mark Brown, kernel test robot

On Mon, 23 Aug 2021 23:33:23 +0800, Tzung-Bi Shih wrote:
> bclk_ms is possible unused by using the given config (see [1]).
> 
> sound/soc/codecs/rt1015.c:724:2: warning: Value stored to 'bclk_ms' is
> never read [clang-analyzer-deadcode.DeadStores]
>            bclk_ms = frame_size > 32;
>            ^         ~~~~~~~~~~~~~~~
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: rt1015: remove possible unused variable `bclk_ms'
      commit: d019403a777e9978767d0551fa55f624baf7df09

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] 2+ messages in thread

end of thread, other threads:[~2021-08-23 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 15:33 [PATCH] ASoC: rt1015: remove possible unused variable `bclk_ms' Tzung-Bi Shih
2021-08-23 17:37 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.