logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Avoid-statement-expression-in-nl_container_of.patch (954B)


  1. From e9b9e271c57d3d3129fa87c8866e91daeffe8144 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sun, 11 Aug 2019 05:14:48 +0000
  4. Subject: [PATCH] Avoid statement expression in nl_container_of
  5. ---
  6. include/netlink/list.h | 5 ++---
  7. 1 file changed, 2 insertions(+), 3 deletions(-)
  8. diff --git a/include/netlink/list.h b/include/netlink/list.h
  9. index 2f20634..f116126 100644
  10. --- a/include/netlink/list.h
  11. +++ b/include/netlink/list.h
  12. @@ -59,9 +59,8 @@ static inline int nl_list_empty(struct nl_list_head *head)
  13. return head->next == head;
  14. }
  15. -#define nl_container_of(ptr, type, member) ({ \
  16. - const __typeof__( ((type *)0)->member ) *__mptr = (ptr);\
  17. - (type *)( (char *)__mptr - (offsetof(type, member)));})
  18. +#define nl_container_of(ptr, type, member) ( \
  19. + (type *)( (char *)(ptr) - (offsetof(type, member))))
  20. #define nl_list_entry(ptr, type, member) \
  21. nl_container_of(ptr, type, member)
  22. --
  23. 2.23.0