Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144371228
D49999.id154217.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.id154217.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
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)
Attached To
Mode
D49999: LinuxKPI: add container_of_const()
Attached
Detach File
Event Timeline
Log In to Comment