Page MenuHomeFreeBSD

D49999.id154217.diff
No OneTemporary

D49999.id154217.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/container_of.h b/sys/compat/linuxkpi/common/include/linux/container_of.h
--- a/sys/compat/linuxkpi/common/include/linux/container_of.h
+++ b/sys/compat/linuxkpi/common/include/linux/container_of.h
@@ -41,6 +41,14 @@
(type *)((uintptr_t)__p - offsetof(type, member)); \
})
+#define container_of_const(ptr, type, member) \
+ _Generic(ptr, \
+ const typeof(*(ptr)) *: \
+ (const type *)container_of(ptr, type, member), \
+ default: \
+ container_of(ptr, type, member) \
+ )
+
#define typeof_member(type, member) __typeof(((type *)0)->member)
#endif

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 9, 2:35 AM (9 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28485130
Default Alt Text
D49999.id154217.diff (642 B)

Event Timeline