Skip to content

Commit

Permalink
ASoC: rt1015: remove possible unused variable `bclk_ms'
Browse files Browse the repository at this point in the history
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
a5db2ca ("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>
Link: https://lore.kernel.org/r/20210823153323.1297723-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Tzung-Bi Shih authored and Mark Brown committed Aug 23, 2021
1 parent a5ec377 commit d019403
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sound/soc/codecs/rt1015.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit d019403

Please sign in to comment.