OpenCloudOS-Kernel/sound/soc/intel/skylake
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
..
Makefile ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only 2020-05-01 17:45:24 +01:00
bxt-sst.c ASoC: Intel: Skylake: Await purge request ack on CNL 2020-03-10 17:44:29 +00:00
cnl-sst-dsp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 490 2019-06-19 17:09:52 +02:00
cnl-sst-dsp.h ASoC: Intel: Skylake: Merge skl_sst and skl into skl_dev struct 2019-07-24 19:41:33 +01:00
cnl-sst.c ASoC: Intel: Skylake: Await purge request ack on CNL 2020-03-10 17:44:29 +00:00
skl-debug.c ASoC: intel: skl: Fix possible buffer overflow in debug outputs 2020-02-19 13:36:15 +00:00
skl-i2s.h ASoC: Intel: Skylake: Replace zero-length array with flexible-array 2020-05-12 17:14:33 +01:00
skl-messages.c ASoC: Intel: Skylake: Print module type instead of id 2019-08-27 19:26:06 +01:00
skl-nhlt.c ASoC: Intel: Skylake: Shield against no-NHLT configurations 2020-03-10 17:44:27 +00:00
skl-pcm.c ASoC: Intel: drop unnecessary list_empty 2020-07-30 22:38:39 +01:00
skl-ssp-clk.c ASoC: SOF/Intel: clarify SPDX license with GPL-2.0-only 2020-05-01 17:45:24 +01:00
skl-ssp-clk.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
skl-sst-cldma.c ASoC: Intel: Skylake: Explicitly include linux/io.h for virt_to_phys() 2019-12-10 10:15:48 +01:00
skl-sst-cldma.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 490 2019-06-19 17:09:52 +02:00
skl-sst-dsp.c ASoC: Intel: Skylake: Merge skl_sst and skl into skl_dev struct 2019-07-24 19:41:33 +01:00
skl-sst-dsp.h ASoC: Intel: Skylake: Await purge request ack on CNL 2020-03-10 17:44:29 +00:00
skl-sst-ipc.c ASoC: Intel: Skylake: large_config_get overhaul 2019-08-08 21:22:33 +01:00
skl-sst-ipc.h ASoC: Intel: Skylake: large_config_get overhaul 2019-08-08 21:22:33 +01:00
skl-sst-utils.c ASoC: Intel: Skylake: Replace guid_copy() with import_guid() 2020-04-23 15:45:31 +01:00
skl-sst.c ASoC: Intel: Skylake: Print constant literals from format specifier 2019-08-15 15:04:23 +01:00
skl-topology.c ASoC: Intel: drop unnecessary list_empty 2020-07-30 22:38:39 +01:00
skl-topology.h ASoC: Intel: Skylake: Avoid the use of one-element array 2020-07-20 15:34:27 +01:00
skl.c Merge branch 'for-5.6' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.7 2020-03-13 18:52:23 +00:00
skl.h ASoC: Intel: Skylake: Replace zero-length array with flexible-array 2020-05-12 17:14:33 +01:00