linux/drivers/media
Julia Lawall 3c9c3902e3 tm6000: 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 14:12:36 +02:00
..
cec media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
common media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
dvb-core media: videobuf2: add queue memory consistency parameter 2020-06-23 13:31:12 +02:00
dvb-frontends media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
firewire media: firewire: Using uninitialized values in node_probe() 2020-07-04 11:57:10 +02:00
i2c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
mc media: mc-device.c: change media_device_request_alloc to match media_ioctl_info 2020-08-29 08:15:23 +02:00
mmc media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
pci saa7134: drop unnecessary list_empty 2020-09-01 13:37:53 +02:00
platform media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
radio media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
rc media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
spi media: i2c/Kconfig: use sub-menus for I2C support 2020-04-16 10:34:40 +02:00
test-drivers media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
tuners media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
usb tm6000: drop unnecessary list_empty 2020-09-01 14:12:36 +02:00
v4l2-core media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume 2020-08-28 15:20:40 +02:00
Kconfig media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00
Makefile media: media/test_drivers: rename to test-drivers 2020-04-16 10:38:31 +02:00