aboutsummaryrefslogtreecommitdiffstats
path: root/src/fst
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-07-18 13:29:44 (GMT)
committerJouni Malinen <j@w1.fi>2015-07-18 14:23:55 (GMT)
commita55ebeac26fa265d784523847c4fd10501863512 (patch)
treedcc7fd7ffa83f095ac7704a7c264ff866f460e88 /src/fst
parent73664e09855f5d9402934a6dfac42d4c0c0a4c63 (diff)
downloadhostap-a55ebeac26fa265d784523847c4fd10501863512.zip
hostap-a55ebeac26fa265d784523847c4fd10501863512.tar.gz
hostap-a55ebeac26fa265d784523847c4fd10501863512.tar.bz2
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. Signed-off-by: Jouni Malinen <j@w1.fi>
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 a6d0de9..568fb86 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 9dcc666..faee262 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 */