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