[PATCH] linux/container_of.h: Remove redundant type cast in container_of_const()
From: Zijun Hu
Date: Fri Aug 02 2024 - 11:15:47 EST
From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
Remove redundant (type *) cast for default branch in container_of_const()
since the cast has been done by container_of().
Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
---
include/linux/container_of.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/container_of.h b/include/linux/container_of.h
index 713890c867be..c36435e7c7f2 100644
--- a/include/linux/container_of.h
+++ b/include/linux/container_of.h
@@ -32,7 +32,7 @@
#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)) \
+ default: container_of(ptr, type, member) \
)
#endif /* _LINUX_CONTAINER_OF_H */
---
base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
change-id: 20240802-container_of_const_fix-87ecdb71ba90
Best regards,
--
Zijun Hu <quic_zijuhu@xxxxxxxxxxx>