mirror_ubuntu-kernels/drivers/net/wireless/ath
Julia Lawall 18c25b4019 ath: 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 for the list_for_each_entry
case is as follows: (http://coccinelle.lip6.fr/)

<smpl>
@@
expression x,e;
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: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1595761112-11003-8-git-send-email-Julia.Lawall@inria.fr
2020-08-14 18:05:06 +03:00
..
ar5523 treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ath5k treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ath6kl treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
ath9k ath9k: Use fallthrough pseudo-keyword 2020-08-14 18:04:06 +03:00
ath10k ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n() 2020-07-20 20:10:16 +03:00
ath11k ath11k: remove define ATH11K_QMI_DEFAULT_CAL_FILE_NAME 2020-06-23 10:52:04 +03:00
carl9170 ath: fix wiki website url 2020-06-09 09:25:25 +03:00
wcn36xx wcn36xx: Use sequence number allocated by mac80211 2020-08-14 18:02:28 +03:00
wil6210 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2020-06-15 20:18:39 +03:00
ath.h
debug.c
dfs_pattern_detector.c ath: drop unnecessary list_empty 2020-08-14 18:05:06 +03:00
dfs_pattern_detector.h
dfs_pri_detector.c
dfs_pri_detector.h
hw.c
Kconfig Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git 2020-06-15 20:18:39 +03:00
key.c
main.c
Makefile ath11k: driver for Qualcomm IEEE 802.11ax devices 2019-11-25 14:16:34 +02:00
reg.h
regd_common.h ath: regd: add extra US coutry codes 2019-02-07 17:02:19 +02:00
regd.c ath: add support for special 0x0 regulatory domain 2019-12-02 12:08:01 +02:00
regd.h ath: drop duplicated define 2019-04-29 17:55:53 +03:00
spectral_common.h ath11k: add support for spectral scan 2020-06-15 17:21:54 +03:00
trace.c
trace.h