linux/drivers/media/usb/cx231xx
Julia Lawall a50732124b media: cx231xx: drop unnecessary list_empty
list_for_each_entry 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 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, 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:
(http://coccinelle.lip6.fr/)

<smpl>
@@
expression x,e;
iterator name list_for_each_entry;
statement S;
identifier i;
@@

-if (!(list_empty(x))) {
   list_for_each_entry(i,x,...) S
- }
 ... when != i
? i = e
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-01 13:31:09 +02:00
..
cx231xx-417.c media: cx231xx: remove redundant assignment to variable err 2020-07-04 12:01:44 +02:00
cx231xx-audio.c media: Drop superfluous ioctl PCM ops 2019-12-13 09:33:22 +01:00
cx231xx-avcore.c media: cx231xx: Remove unneeded semicolon 2020-05-05 17:09:04 +02:00
cx231xx-cards.c media: cx231xx: convert to the vb2 framework 2019-10-01 17:23:44 -03:00
cx231xx-conf-reg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
cx231xx-core.c media: cx231xx: drop unnecessary list_empty 2020-09-01 13:31:09 +02:00
cx231xx-dif.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
cx231xx-dvb.c media: cx231xx: constify copied structure 2020-02-24 15:23:48 +01:00
cx231xx-i2c.c media: cx231xx: replace BUG_ON with recovery code 2020-01-08 14:27:51 +01:00
cx231xx-input.c media: usb: cx231xx: convert to use i2c_new_client_device() 2020-04-14 11:31:32 +02:00
cx231xx-pcb-cfg.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
cx231xx-pcb-cfg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
cx231xx-reg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
cx231xx-vbi.c media: cx231xx: convert to the vb2 framework 2019-10-01 17:23:44 -03:00
cx231xx-vbi.h media: cx231xx: convert to the vb2 framework 2019-10-01 17:23:44 -03:00
cx231xx-video.c media: cx231xx: Add i2c device analog tuner support 2020-04-21 16:50:05 +02:00
cx231xx.h media: cx231xx: convert to the vb2 framework 2019-10-01 17:23:44 -03:00
Kconfig Revert "media: Kconfig: better support hybrid TV devices" 2020-04-14 11:00:30 +02:00
Makefile media: prefix header search paths with $(srctree)/ 2019-05-18 11:49:56 +09:00