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

Vinesh Raut vineshraut2017 at gmail.com
Fri Aug 6 15:18:41 UTC 2021


Add verbose description for UNNECESSARY_CASTS message type.

Suggested-by: Lukas Bulwahn <lukas.bulwahn at gmail.com>
Signed-off-by: Vinesh Raut <vineshraut2017 at gmail.com>
---
 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



More information about the Linux-kernel-mentees mailing list