Files
oasis-linux-mirror/pkg/libnl/patch/0002-Avoid-statement-expression-in-nl_container_of.patch
2019-10-04 18:34:31 -07:00

29 lines
954 B
Diff

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