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 3f7a20f30c23aead6460e18fda27ba439b369045 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 2 Jul 2019 19:53:34 -0700
Subject: [PATCH] Avoid statement expression in container_of macro
---
sshfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/sshfs.c b/sshfs.c
index 133b248..8f974e2 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -522,9 +522,8 @@ static const char *type_name(uint8_t type)
}
}
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+#define container_of(ptr, type, member) ( \
+ (type *)( (char *)(ptr) - offsetof(type,member) ))
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
--
2.24.0
|