Thread (4 messages) 4 messages, 2 authors, 2021-08-09
STALE1806d

[PATCH v2] Documentation: checkpatch: add UNNECESSARY_CASTS message.

From: Vinesh Raut <hidden>
Date: 2021-08-06 15:19:16
Subsystem: checkpatch documentation, documentation, documentation process, the rest · Maintainers: Dwaipayan Ray, Lukas Bulwahn, Jonathan Corbet, Linus Torvalds

Add verbose description for UNNECESSARY_CASTS message type.

Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Vinesh Raut <redacted>
---
 Documentation/dev-tools/checkpatch.rst | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst
index f0956e9ea2d8..9cb6b9059fc6 100644
--- a/Documentation/dev-tools/checkpatch.rst
+++ b/Documentation/dev-tools/checkpatch.rst
@@ -268,6 +268,15 @@ Allocation style
 
     See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html
 
+   **UNNECESSAR_CASTS**
+   Cast should not be done to any alloc functions.
+   Appropriate type of pointer is pick by compiler at run time
+   Cast may hide bugs, as compiler suppress the warning after cast.
+
+   See:
+   1] https://lore.kernel.org/lkml/20070808024321.GA6316@redhat.com/
+   2] https://lore.kernel.org/lkml/a5e60a2b93e10baf84af063f6c8e56402273105d.camel@perches.com/
+
 
 API usage
 ---------
-- 
2.30.2

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help