/* * Simple doubly linked list, based on the Linux kernel linked list. * * Copyright (C) 2015 Tobias Klauser * * This file is part of llmnrd. * * llmnrd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * llmnrd is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with llmnrd. If not, see . */ #ifndef LIST_H #define LIST_H #include #include "compiler.h" struct list_head { struct list_head *next, *prev; }; static inline void INIT_LIST_HEAD(struct list_head *list) { list->next = list; list->prev = list; } static inline void __list_add(struct list_head *obj, struct list_head *prev, struct list_head *next) { prev->next = obj; obj->prev = prev; obj->next = next; next->prev = obj; } static inline void list_add_tail(struct list_head *obj, struct list_head *head) { __list_add(obj, head->prev, head); } static inline void list_add_head(struct list_head *obj, struct list_head *head) { __list_add(obj, head, head->next); } static inline void list_del(struct list_head *obj) { obj->next->prev = obj->prev; obj->prev->next = obj->next; } static inline bool list_empty(struct list_head *head) { return head->next == head; } #define list_entry(ptr, type, member) container_of(ptr, type, member) #define list_for_each_entry(pos, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member); \ &(pos)->member != (head); \ (pos) = list_entry((pos)->member.next, typeof(*(pos)), member)) #define list_for_each_entry_safe(pos, n, head, member) \ for (pos = list_entry((head)->next, typeof(*pos), member), \ n = list_entry(pos->member.next, typeof(*pos), member); \ &(pos)->member != (head); \ pos = n, n = list_entry(n->member.next, typeof(*n), member)) #endif /* LIST_H */ g msg
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-04-16 22:15:46 +0200
committerBjorn Helgaas <bhelgaas@google.com>2016-05-02 11:59:48 -0500
commit76ba8c1f2312e5128ef33e00a29c72c85bb80068 (patch)
tree227f98d0324b011bc3ea7783ae8f07e588e90859
parent9735a22799b9214d17d3c231fe377fc852f042e9 (diff)
PCI: rcar: Select PCI_MSI_IRQ_DOMAIN
The R-Car PCIe driver requires the use of IRQ domains for its MSI code: drivers/pci/host/pcie-rcar.c:635:9: error: implicit declaration of function 'irq_find_mapping' [-Werror=implicit-function-declaration] drivers/pci/host/pcie-rcar.c:666:8: error: implicit declaration of function 'irq_create_mapping' [-Werror=implicit-function-declaration] ... Add a Kconfig select to ensure that the feature is always enabled. This is not consistent with what the other drivers do at the moment, but I have another patch that changes them to do it like this one, which is more logical. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Simon Horman <horms+renesas@verge.net.au>