diff options
author | Joe Perches <joe@perches.com> | 2020-10-16 06:11:56 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-16 21:11:20 +0300 |
commit | 40873aba2c6b96c6f21265e6508eaa3de145e30a (patch) | |
tree | 8ac50b404a973ac9ff05589b6db515992c5cdb57 /lib/test_linear_ranges.c | |
parent | 310cd06ba2496002481eb7fd3b02c51d115aa115 (diff) | |
download | linux-40873aba2c6b96c6f21265e6508eaa3de145e30a.tar.xz |
checkpatch: add test for comma use that should be semicolon
There are commas used as statement terminations that should typically have
used semicolons instead. Only direct assignments or use of a single
function or value on a single line are detected by this test.
e.g.:
foo = bar(), /* typical use is semicolon not comma */
bar = baz();
Add an imperfect test to detect these comma uses.
No false positives were found in testing, but many types of false
negatives are possible.
e.g.:
foo = bar() + 1, /* comma use, but not direct assignment */
bar = baz();
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/3bf27caf462007dfa75647b040ab3191374a59de.camel@perches.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/test_linear_ranges.c')
0 files changed, 0 insertions, 0 deletions