aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-18 16:29:44 +0300
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:19:51 -0600
commit3748533d46ccec5f6efed1f8cf13b16807def904 (patch)
tree12a4b2715b9555e2de15dee513f22eef9f53cff7 /src/fst
parentebc1c5a7c03b79684ba26dd89714b1292c119731 (diff)
downloadandroid_external_wpa_supplicant_8-3748533d46ccec5f6efed1f8cf13b16807def904.tar.gz
android_external_wpa_supplicant_8-3748533d46ccec5f6efed1f8cf13b16807def904.tar.bz2
android_external_wpa_supplicant_8-3748533d46ccec5f6efed1f8cf13b16807def904.zip
FST: Remove duplicated dl_list_empty() check befor dl_list_first()
dl_list_first() takes care of this already, so there is no need to do a separate check here. Change-Id: I5d576778e2135286631d7fb39aa4458f122615da Signed-off-by: Jouni Malinen <j@w1.fi> Git-commit: a55ebeac26fa265d784523847c4fd10501863512 Git-repo: git://w1.fi/srv/git/hostap.git CRs-Fixed: 891455
Diffstat (limited to 'src/fst')
-rw-r--r--src/fst/fst.c10
-rw-r--r--src/fst/fst_group.h6
2 files changed, 5 insertions, 11 deletions
diff --git a/src/fst/fst.c b/src/fst/fst.c
index a6d0de9a..568fb863 100644
--- a/src/fst/fst.c
+++ b/src/fst/fst.c
@@ -134,17 +134,15 @@ int fst_global_init(void)
void fst_global_deinit(void)
{
struct fst_group *group;
+ struct fst_ctrl_handle *h;
fst_session_global_deinit();
while ((group = fst_first_group()) != NULL)
fst_group_delete(group);
- while (!dl_list_empty(&fst_global_ctrls_list)) {
- struct fst_ctrl_handle *h;
-
- h = dl_list_first(&fst_global_ctrls_list,
- struct fst_ctrl_handle, global_ctrls_lentry);
+ while ((h = dl_list_first(&fst_global_ctrls_list,
+ struct fst_ctrl_handle,
+ global_ctrls_lentry)))
fst_global_del_ctrl(h);
- }
}
diff --git a/src/fst/fst_group.h b/src/fst/fst_group.h
index 9dcc6669..faee2629 100644
--- a/src/fst/fst_group.h
+++ b/src/fst/fst_group.h
@@ -36,8 +36,6 @@ static inline Boolean fst_group_has_ifaces(struct fst_group *g)
static inline struct fst_iface * fst_group_first_iface(struct fst_group *g)
{
- if (dl_list_empty(&g->ifaces))
- return NULL;
return dl_list_first(&g->ifaces, struct fst_iface, group_lentry);
}
@@ -70,10 +68,8 @@ extern struct dl_list fst_global_groups_list;
static inline struct fst_group * fst_first_group(void)
{
- if (dl_list_empty(&fst_global_groups_list))
- return NULL;
return dl_list_first(&fst_global_groups_list, struct fst_group,
- global_groups_lentry);
+ global_groups_lentry);
}
#endif /* FST_GROUP_H */