mirror of
https://github.com/oasislinux/oasis.git
synced 2026-06-21 15:37:15 +02:00
29 lines
811 B
Diff
29 lines
811 B
Diff
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
|
|
|