summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2020-11-11 15:43:17 -0600
committerMark Brown <broonie@kernel.org>2020-11-12 15:15:53 +0000
commit17f6433192d858e49a40d1fa939bf61cc493a3b7 (patch)
tree8224ff8b8ef338025d5f7c90adb1bca121690490 /sound/soc/codecs
parent4a55000722d74e4ad1ea4700a423e21fab0d53ba (diff)
downloadlinux-17f6433192d858e49a40d1fa939bf61cc493a3b7.tar.bz2
ASoC: rt711: remove warnings
cppcheck complains, use separate loop variable for sink and source ports sound/soc/codecs/rt711-sdw.c:382:4: style: Variable 'i' is reassigned a value before the old one has been used. [redundantAssignment] i = 0; ^ sound/soc/codecs/rt711-sdw.c:371:4: note: i is assigned i++; ^ sound/soc/codecs/rt711-sdw.c:382:4: note: i is overwritten i = 0; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Link: https://lore.kernel.org/r/20201111214318.150529-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/rt711-sdw.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index f0a0691bd31c..fc7df79c3b91 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -338,7 +338,8 @@ static int rt711_update_status(struct sdw_slave *slave,
static int rt711_read_prop(struct sdw_slave *slave)
{
struct sdw_slave_prop *prop = &slave->prop;
- int nval, i;
+ int nval;
+ int i, j;
u32 bit;
unsigned long addr;
struct sdw_dpn_prop *dpn;
@@ -379,15 +380,15 @@ static int rt711_read_prop(struct sdw_slave *slave)
if (!prop->sink_dpn_prop)
return -ENOMEM;
- i = 0;
+ j = 0;
dpn = prop->sink_dpn_prop;
addr = prop->sink_ports;
for_each_set_bit(bit, &addr, 32) {
- dpn[i].num = bit;
- dpn[i].type = SDW_DPN_FULL;
- dpn[i].simple_ch_prep_sm = true;
- dpn[i].ch_prep_timeout = 10;
- i++;
+ dpn[j].num = bit;
+ dpn[j].type = SDW_DPN_FULL;
+ dpn[j].simple_ch_prep_sm = true;
+ dpn[j].ch_prep_timeout = 10;
+ j++;
}
/* set the timeout values */