Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163287101
D49999.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
642 B
Referenced Files
None
Subscribers
None
D49999.id.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Jul 22, 6:19 PM (25 m, 2 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35375943
Default Alt Text
D49999.id.diff (642 B)
Attached To
Mode
D49999: LinuxKPI: add container_of_const()
Attached
Detach File
Event Timeline
Log In to Comment