linux-stable/sound/soc
Julia Lawall a383308e50
ASoC: Intel: drop unnecessary list_empty
list_for_each_entry_safe is able to handle an empty list.
The only effect of avoiding the loop is not initializing the
index variable.
Drop list_empty tests in cases where these variables are not
used.

Note that list_for_each_entry_safe is defined in terms of
list_first_entry, which indicates that it should not be used on an
empty list.  But in list_for_each_entry_safe, the element obtained by
list_first_entry is not really accessed, only the address of its
list_head field is compared to the address of the list head, so the
list_first_entry is safe.

The semantic patch that makes this change is as follows (with another
variant for the no brace case): (http://coccinelle.lip6.fr/)

<smpl>
@@
expression x,e;
iterator name list_for_each_entry_safe;
statement S;
identifier i,j;
@@
-if (!(list_empty(x))) {
   list_for_each_entry_safe(i,j,x,...) S
- }
 ... when != i
     when != j
(
  i = e;
|
? j = e;
)
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/1595761112-11003-2-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-30 22:38:39 +01:00
..
adi
amd ASoC: amd: Added hw_params support for ALC1015 2020-07-30 21:00:34 +01:00
atmel ASoC: atmel: use asoc_substream_to_rtd() 2020-07-23 19:07:33 +01:00
au1x ASoC: au1x: use asoc_substream_to_rtd() 2020-07-23 19:07:36 +01:00
bcm ASoC: bcm2835: Silence clk_get() error on -EPROBE_DEFER 2020-07-28 17:04:07 +01:00
cirrus ASoC: cirrus: use asoc_substream_to_rtd() 2020-07-23 19:07:28 +01:00
codecs Merge series "ASoC: meson: tdm fixes" from Jerome Brunet <jbrunet@baylibre.com>: 2020-07-30 21:00:36 +01:00
dwc ASoC: dwc: use asoc_substream_to_rtd() 2020-07-23 19:07:34 +01:00
fsl Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: 2020-07-23 19:52:30 +01:00
generic ASoC: generic: use asoc_substream_to_rtd() 2020-07-23 19:07:39 +01:00
hisilicon ASoC: hisilicon: Use the defined variable to clean code 2020-04-27 14:08:44 +01:00
img ASoC: img-parallel-out: Fix a reference count leak 2020-06-15 20:58:35 +01:00
intel ASoC: Intel: drop unnecessary list_empty 2020-07-30 22:38:39 +01:00
jz4740 ASoC: ingenic: Unconditionally depend on devicetree 2020-05-28 13:20:17 +01:00
kirkwood ASoC: kirkwood: use asoc_substream_to_rtd() 2020-07-23 19:07:41 +01:00
mediatek ASoC: mediatek: use asoc_substream_to_rtd() 2020-07-23 19:07:32 +01:00
meson Merge series "ASoC: meson: tdm fixes" from Jerome Brunet <jbrunet@baylibre.com>: 2020-07-30 21:00:36 +01:00
mxs ASoC: mxs: use asoc_substream_to_rtd() 2020-07-23 19:07:43 +01:00
pxa ASoC: pxa: use asoc_substream_to_rtd() 2020-07-23 19:07:27 +01:00
qcom ASoC: dt-bindings: q6asm: Add Q6ASM_DAI_{TX_RX, TX, RX} defines 2020-07-27 14:21:09 +01:00
rockchip ASoC: rockchip: use asoc_substream_to_rtd() 2020-07-23 19:07:29 +01:00
samsung ASoC: samsung: Add sound support for Midas boards 2020-07-30 21:00:29 +01:00
sh ASoC: sh: use asoc_substream_to_rtd() 2020-07-23 19:07:25 +01:00
sirf
sof ASoC: SOF: Intel: disable traces when switching to S0Ix D0I3 2020-07-28 16:22:35 +01:00
spear ASoC: spear: merge .digital_mute() into .mute_stream() 2020-07-16 23:06:08 +01:00
sprd ASoC: sprd: use asoc_substream_to_rtd() 2020-07-23 19:07:40 +01:00
sti ASoC: sti: uniperif: fix 'defined by not used' warning 2020-07-10 15:13:44 +01:00
stm ASoC: stm: use asoc_substream_to_rtd() 2020-07-23 19:07:23 +01:00
sunxi ASoC: sunxi: use asoc_substream_to_rtd() 2020-07-23 19:07:23 +01:00
tegra Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: 2020-07-23 19:52:30 +01:00
ti Merge series "ASoC: add asoc_substream_to_rtd() macro" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>: 2020-07-23 19:52:30 +01:00
txx9 ASoC: txx9: add back the hack for a too small resource_size_t 2020-04-21 20:01:50 +02:00
uniphier ASoC: uniphier: use asoc_substream_to_rtd() 2020-07-23 19:07:43 +01:00
ux500 ASoC: ux500: use asoc_substream_to_rtd() 2020-07-23 19:07:20 +01:00
xilinx
xtensa ASoC: xtensa: use asoc_substream_to_rtd() 2020-07-23 19:07:42 +01:00
zte
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile ASoC: soc-component: merge soc-io.c into soc-component.c 2020-06-15 18:21:26 +01:00
soc-ac97.c ASoC: soc-ac97: fix kernel-doc 2020-07-03 17:33:46 +01:00
soc-acpi.c
soc-card.c ASoC: soc-card: add snd_soc_card_remove_dai_link() 2020-05-30 02:11:42 +01:00
soc-component.c ASoC: soc-component: don't report of_xlate_dai_name failures 2020-07-24 15:22:32 +01:00
soc-compress.c ASoC: soc-pcm/compress: reduce verbosity on mapping ok messages 2020-06-15 17:12:11 +01:00
soc-core.c ASoC: soc-core: snd_soc_dai_digital_mute() for both CPU/Codec 2020-07-17 14:22:56 +01:00
soc-dai.c ASoC: soc-xxx: add asoc_substream_to_rtd() 2020-07-23 19:07:19 +01:00
soc-dapm.c ASoC: dapm: don't call pm_runtime_* on card device 2020-07-24 17:27:53 +01:00
soc-devres.c ASoC: core: Remove only the registered component in devm functions 2020-07-07 11:55:46 +01:00
soc-generic-dmaengine-pcm.c ASoC: soc-xxx: add asoc_substream_to_rtd() 2020-07-23 19:07:19 +01:00
soc-jack.c ASoC: soc-card: move snd_soc_card_jack_new() to soc-card 2020-05-30 02:11:28 +01:00
soc-link.c ASoC: soc-xxx: add asoc_substream_to_rtd() 2020-07-23 19:07:19 +01:00
soc-ops.c ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32() 2020-06-22 15:13:36 +01:00
soc-pcm.c ASoC: soc-xxx: add asoc_substream_to_rtd() 2020-07-23 19:07:19 +01:00
soc-topology.c ASoC: topology: add more logs when topology load fails. 2020-07-08 14:25:22 +01:00
soc-utils.c ASoC: soc-xxx: add asoc_substream_to_rtd() 2020-07-23 19:07:19 +01:00