diff options
author | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-19 20:07:29 +0100 |
---|---|---|
committer | Alejandro Colomar <alx.manpages@gmail.com> | 2021-11-20 17:04:53 +0100 |
commit | 0f35ba34ecd7e820397f55cbc6d7201eb9530076 (patch) | |
tree | 927539ba680ba2736902f9c9202acce00e2f2773 | |
parent | 741ab0a90e358a4d5e529911e622a71aa67a021d (diff) |
drivers/gpu/drm/nouveau/: Don't redefine container_of()
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/include/nvif/list.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvif/list.h b/drivers/gpu/drm/nouveau/include/nvif/list.h index 8af5d144ecb0..f6728d133b7e 100644 --- a/drivers/gpu/drm/nouveau/include/nvif/list.h +++ b/drivers/gpu/drm/nouveau/include/nvif/list.h @@ -97,6 +97,10 @@ * */ + +#include <linux/container_of.h> + + /** * The linkage struct for list nodes. This struct must be part of your * to-be-linked struct. struct list_head is required for both the head of the @@ -238,24 +242,6 @@ list_empty(struct list_head *head) } /** - * Returns a pointer to the container of this list element. - * - * Example: - * struct foo* f; - * f = container_of(&foo->entry, struct foo, entry); - * assert(f == foo); - * - * @param ptr Pointer to the struct list_head. - * @param type Data type of the list element. - * @param member Member name of the struct list_head field in the list element. - * @return A pointer to the data struct containing the list head. - */ -#ifndef container_of -#define container_of(ptr, type, member) \ - (type *)((char *)(ptr) - (char *) &((type *)0)->member) -#endif - -/** * Alias of container_of */ #define list_entry(ptr, type, member) \ |