diff options
author | Jonathan Corbet <corbet@lwn.net> | 2021-10-05 02:12:56 +0300 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2021-10-05 02:13:53 +0300 |
commit | b19511926cb50d59c57189739d03c21df325710f (patch) | |
tree | 1c4c591269ac9af0a0bd052a21c5b70f1d4829a7 | |
parent | b718f9d919d16fb7b97a890f74d34593d9cecd20 (diff) | |
download | linux-b19511926cb50d59c57189739d03c21df325710f.tar.xz |
Revert "docs: checkpatch: add UNNECESSARY/UNSPECIFIED_INT and UNNECESSARY_ELSE"
This reverts commit cbb817fc2effcbee0eb44303eefbc8171fc2b12f.
Late-arriving nacks make it clear that I applied this one too soon.
Link: https://lore.kernel.org/lkml/CAKXUXMzEFQd1JJhx4ZbBQiuSB7Fk3bd7dwJYmPOvEtMqZopxpg@mail.gmail.com/
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r-- | Documentation/dev-tools/checkpatch.rst | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst index 5cbc8463b1f0..b52452bc2963 100644 --- a/Documentation/dev-tools/checkpatch.rst +++ b/Documentation/dev-tools/checkpatch.rst @@ -999,13 +999,6 @@ Functions and Variables return bar; - **UNNECESSARY_INT** - int used after short, long and long long is unnecessary. So remove it. - - **UNSPECIFIED_INT** - Kernel style prefers "unsigned int <foo>" over "unsigned <foo>" and - "signed int <foo>" over "signed <foo>". - Permissions ----------- @@ -1254,43 +1247,3 @@ Others **TYPO_SPELLING** Some words may have been misspelled. Consider reviewing them. - - **UNNECESSARY_ELSE** - Using an else statement just after a return or a break statement is - unnecassary. For example:: - - for (i = 0; i < 100; i++) { - int foo = bar(); - if (foo < 1) - break; - else - usleep(1); - } - - is generally better written as:: - - for (i = 0; i < 100; i++) { - int foo = bar(); - if (foo < 1) - break; - usleep(1); - } - - So remove the else statement. But suppose if a if-else statement each - with a single return statement, like:: - - if (foo) - return bar; - else - return baz; - - then by removing the else statement:: - - if (foo) - return bar; - return baz; - - their is no significant increase in the readability and one can argue - that the first form is more readable because of indentation, so for - such cases do not convert the existing code from first form to second - form or vice-versa. |