Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l56-test: Remove pointless duplicate loop counters

In cs35l56_test_parse_xu_onchip_spkid() the first two loops used
local i to index an array and num_gpios/num_pulls to count how
many entries it had seen. But both i and num_* started at 0 and
incremented on each loop so were identical. Remove i from these
loops.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20260309115651.1090368-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
66f71ec3 a2614f29

+5 -6
+5 -6
sound/soc/codecs/cs35l56-test.c
··· 364 364 struct cs35l56_test_priv *priv = test->priv; 365 365 struct cs35l56_private *cs35l56 = priv->cs35l56_priv; 366 366 struct software_node *ext0_node; 367 - int num_gpios = 0; 368 - int num_pulls = 0; 367 + int num_gpios, num_pulls; 369 368 int i; 370 369 371 - for (i = 0; i < ARRAY_SIZE(param->spkid_gpios); i++, num_gpios++) { 372 - if (param->spkid_gpios[i] < 0) 370 + for (num_gpios = 0; num_gpios < ARRAY_SIZE(param->spkid_gpios); num_gpios++) { 371 + if (param->spkid_gpios[num_gpios] < 0) 373 372 break; 374 373 } 375 374 KUNIT_ASSERT_LE(test, num_gpios, ARRAY_SIZE(cs35l56->base.onchip_spkid_gpios)); 376 375 377 - for (i = 0; i < ARRAY_SIZE(param->spkid_pulls); i++, num_pulls++) { 378 - if (param->spkid_pulls[i] < 0) 376 + for (num_pulls = 0; num_pulls < ARRAY_SIZE(param->spkid_pulls); num_pulls++) { 377 + if (param->spkid_pulls[num_pulls] < 0) 379 378 break; 380 379 } 381 380 KUNIT_ASSERT_LE(test, num_pulls, ARRAY_SIZE(cs35l56->base.onchip_spkid_pulls));