]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: warn on self-assignments
authorJoe Perches <joe@perches.com>
Fri, 16 Oct 2020 03:12:09 +0000 (20:12 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Oct 2020 18:11:21 +0000 (11:11 -0700)
commit9de5aca25b2481647ded30781ecd709b524e7ed5
tree2f209a09fbe8a7a1dc9a5dfe461b565476df9fa0
parent71a95c53ae1e10d9295696d2f4058944000cb194
checkpatch: warn on self-assignments

The uninitialized_var() macro was removed recently via commit c6690e460842
("compiler: Remove uninitialized_var() macro") as it's not a particularly
useful warning and its use can "paper over real bugs".

Add a checkpatch test to warn on self-assignments as a means to avoid
compiler warnings and as a back-door mechanism to reproduce the old
uninitialized_var macro behavior.

[akpm@linux-foundation.org: coding style fixes]

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: Denis Efremov <efremov@linux.com>
Cc: Julia Lawall <julia.lawall@inria.fr>
Link: https://lkml.kernel.org/r/afc2cffdd315d3e4394af149278df9e8af7f49f4.camel@perches.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl