summaryrefslogtreecommitdiff
path: root/pkg/libnl/patch/0002-Avoid-statement-expression-in-nl_container_of.patch
blob: f0a7aea3ddfc47151416b028898379d963168ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From e9b9e271c57d3d3129fa87c8866e91daeffe8144 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 11 Aug 2019 05:14:48 +0000
Subject: [PATCH] Avoid statement expression in nl_container_of

---
 include/netlink/list.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/netlink/list.h b/include/netlink/list.h
index 2f20634..f116126 100644
--- a/include/netlink/list.h
+++ b/include/netlink/list.h
@@ -59,9 +59,8 @@ static inline int nl_list_empty(struct nl_list_head *head)
 	return head->next == head;
 }
 
-#define nl_container_of(ptr, type, member) ({			\
-        const __typeof__( ((type *)0)->member ) *__mptr = (ptr);\
-        (type *)( (char *)__mptr - (offsetof(type, member)));})
+#define nl_container_of(ptr, type, member) (			\
+        (type *)( (char *)(ptr) - (offsetof(type, member))))
 
 #define nl_list_entry(ptr, type, member) \
 	nl_container_of(ptr, type, member)
-- 
2.23.0