treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / wireless / quantenna / qtnfmac / util.h
bloba14b7078a9c7065dd4ab7360c43f60904659b157
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (c) 2015 Quantenna Communications. All rights reserved. */
4 #ifndef QTNFMAC_UTIL_H
5 #define QTNFMAC_UTIL_H
7 #include <linux/kernel.h>
8 #include "core.h"
10 const char *qtnf_chipid_to_string(unsigned long chip_id);
12 void qtnf_sta_list_init(struct qtnf_sta_list *list);
14 struct qtnf_sta_node *qtnf_sta_list_lookup(struct qtnf_sta_list *list,
15 const u8 *mac);
16 struct qtnf_sta_node *qtnf_sta_list_lookup_index(struct qtnf_sta_list *list,
17 size_t index);
18 struct qtnf_sta_node *qtnf_sta_list_add(struct qtnf_vif *vif,
19 const u8 *mac);
20 bool qtnf_sta_list_del(struct qtnf_vif *vif, const u8 *mac);
22 void qtnf_sta_list_free(struct qtnf_sta_list *list);
24 static inline size_t qtnf_sta_list_size(const struct qtnf_sta_list *list)
26 return atomic_read(&list->size);
29 static inline bool qtnf_sta_list_empty(const struct qtnf_sta_list *list)
31 return list_empty(&list->head);
34 #endif /* QTNFMAC_UTIL_H */