checkpatch/coding-style: deprecate 80-column warning

Yes, staying withing 80 columns is certainly still _preferred_. But
it's not the hard limit that the checkpatch warnings imply, and other
concerns can most certainly dominate.

Increase the default limit to 100 characters. Not because 100
characters is some hard limit either, but that's certainly a "what are
you doing" kind of value and less likely to be about the occasional
slightly longer lines.

Miscellanea:

- to avoid unnecessary whitespace changes in files, checkpatch will no
longer emit a warning about line length when scanning files unless
--strict is also used

- Add a bit to coding-style about alignment to open parenthesis

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Joe Perches and committed by Linus Torvalds bdc48fa1 8fc984ae

Changed files
+22 -13
Documentation
scripts
+13 -8
Documentation/process/coding-style.rst
··· 84 84 Coding style is all about readability and maintainability using commonly 85 85 available tools. 86 86 87 - The limit on the length of lines is 80 columns and this is a strongly 88 - preferred limit. 87 + The preferred limit on the length of a single line is 80 columns. 89 88 90 - Statements longer than 80 columns will be broken into sensible chunks, unless 91 - exceeding 80 columns significantly increases readability and does not hide 92 - information. Descendants are always substantially shorter than the parent and 93 - are placed substantially to the right. The same applies to function headers 94 - with a long argument list. However, never break user-visible strings such as 95 - printk messages, because that breaks the ability to grep for them. 89 + Statements longer than 80 columns should be broken into sensible chunks, 90 + unless exceeding 80 columns significantly increases readability and does 91 + not hide information. 92 + 93 + Descendants are always substantially shorter than the parent and are 94 + are placed substantially to the right. A very commonly used style 95 + is to align descendants to a function open parenthesis. 96 + 97 + These same rules are applied to function headers with a long argument list. 98 + 99 + However, never break user-visible strings such as printk messages because 100 + that breaks the ability to grep for them. 96 101 97 102 98 103 3) Placing Braces and Spaces
+9 -5
scripts/checkpatch.pl
··· 51 51 my @ignore = (); 52 52 my $help = 0; 53 53 my $configuration_file = ".checkpatch.conf"; 54 - my $max_line_length = 80; 54 + my $max_line_length = 100; 55 55 my $ignore_perl_version = 0; 56 56 my $minimum_perl_version = 5.10.0; 57 57 my $min_conf_desc_length = 4; ··· 97 97 --types TYPE(,TYPE2...) show only these comma separated message types 98 98 --ignore TYPE(,TYPE2...) ignore various comma separated message types 99 99 --show-types show the specific message type in the output 100 - --max-line-length=n set the maximum line length, if exceeded, warn 100 + --max-line-length=n set the maximum line length, (default $max_line_length) 101 + if exceeded, warn on patches 102 + requires --strict for use with --file 101 103 --min-conf-desc-length=n set the min description length, if shorter, warn 102 - --tab-size=n set the number of spaces for tab (default 8) 104 + --tab-size=n set the number of spaces for tab (default $tabsize) 103 105 --root=PATH PATH to the kernel tree root 104 106 --no-summary suppress the per-file summary 105 107 --mailback only produce a report in case of warnings/errors ··· 3242 3240 3243 3241 if ($msg_type ne "" && 3244 3242 (show_type("LONG_LINE") || show_type($msg_type))) { 3245 - WARN($msg_type, 3246 - "line over $max_line_length characters\n" . $herecurr); 3243 + my $msg_level = \&WARN; 3244 + $msg_level = \&CHK if ($file); 3245 + &{$msg_level}($msg_type, 3246 + "line length of $length exceeds $max_line_length columns\n" . $herecurr); 3247 3247 } 3248 3248 } 3249 3249