diff options
-rw-r--r-- | container_of_const_switch.patch | 31 | ||||
-rw-r--r-- | series | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/container_of_const_switch.patch b/container_of_const_switch.patch new file mode 100644 index 00000000000000..649b168578bd3d --- /dev/null +++ b/container_of_const_switch.patch @@ -0,0 +1,31 @@ + + +--- + include/linux/container_of.h | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/include/linux/container_of.h ++++ b/include/linux/container_of.h +@@ -15,7 +15,7 @@ + * + * WARNING: any const qualifier of @ptr is lost. + */ +-#define container_of(ptr, type, member) ({ \ ++#define __container_of(ptr, type, member) ({ \ + void *__mptr = (void *)(ptr); \ + static_assert(__same_type(*(ptr), ((type *)0)->member) || \ + __same_type(*(ptr), void), \ +@@ -31,8 +31,11 @@ + */ + #define container_of_const(ptr, type, member) \ + _Generic(ptr, \ +- const typeof(*(ptr)) *: ((const type *)container_of(ptr, type, member)),\ +- default: ((type *)container_of(ptr, type, member)) \ ++ const typeof(*(ptr)) *: ((const type *)__container_of(ptr, type, member)),\ ++ default: ((type *)__container_of(ptr, type, member)) \ + ) + ++#define container_of(ptr, type, member) container_of_const(ptr, type, member) ++ ++ + #endif /* _LINUX_CONTAINER_OF_H */ @@ -1,4 +1,5 @@ # +container_of_const_switch.patch 0001-misc-convert-to-guards.patch 0001-USB-gadget-dummy_hcd-switch-char-to-u8.patch 0001-driver-core-add-printk-debugging.patch |