static inline void
__ipq_enqueue_entry(struct ipq_queue_entry *entry)
{
- list_add(&entry->list, &queue_list);
+ list_add_tail(&entry->list, &queue_list);
queue_total++;
}
static inline struct ipq_queue_entry *
__ipq_find_entry(ipq_cmpfn cmpfn, unsigned long data)
{
- struct list_head *p;
-
- list_for_each_prev(p, &queue_list) {
- struct ipq_queue_entry *entry = (struct ipq_queue_entry *)p;
+ struct ipq_queue_entry *entry;
+ list_for_each_entry(entry, &queue_list, list) {
if (!cmpfn || cmpfn(entry, data))
return entry;
}
static inline void
__ipq_enqueue_entry(struct ipq_queue_entry *entry)
{
- list_add(&entry->list, &queue_list);
+ list_add_tail(&entry->list, &queue_list);
queue_total++;
}
static inline struct ipq_queue_entry *
__ipq_find_entry(ipq_cmpfn cmpfn, unsigned long data)
{
- struct list_head *p;
-
- list_for_each_prev(p, &queue_list) {
- struct ipq_queue_entry *entry = (struct ipq_queue_entry *)p;
+ struct ipq_queue_entry *entry;
+ list_for_each_entry(entry, &queue_list, list) {
if (!cmpfn || cmpfn(entry, data))
return entry;
}
__enqueue_entry(struct nfqnl_instance *queue,
struct nfqnl_queue_entry *entry)
{
- list_add(&entry->list, &queue->queue_list);
+ list_add_tail(&entry->list, &queue->queue_list);
queue->queue_total++;
}
__find_entry(struct nfqnl_instance *queue, nfqnl_cmpfn cmpfn,
unsigned long data)
{
- struct list_head *p;
-
- list_for_each_prev(p, &queue->queue_list) {
- struct nfqnl_queue_entry *entry = (struct nfqnl_queue_entry *)p;
+ struct nfqnl_queue_entry *entry;
+ list_for_each_entry(entry, &queue->queue_list, list) {
if (!cmpfn || cmpfn(entry, data))
return entry;
}