Skip to content

Commit

Permalink
tools: ignore FSF warning, fn macros in checkpatch
Browse files Browse the repository at this point in the history
* Unlike Linux we do require the GPL file header
* When checking for spaces between function names and parentheses,
  ignore all-uppercase function names as these are likely to be macros,
  and function-like macros may have that space

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
  • Loading branch information
qlyoung committed Feb 23, 2018
1 parent 86d488c commit f2a010f
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions tools/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2766,18 +2766,6 @@ sub process {
$rpt_cleaners = 1;
}

# Check for FSF mailing addresses.
if ($rawline =~ /\bwrite to the Free/i ||
$rawline =~ /\b675\s+Mass\s+Ave/i ||
$rawline =~ /\b59\s+Temple\s+Pl/i ||
$rawline =~ /\b51\s+Franklin\s+St/i) {
my $herevet = "$here\n" . cat_vet($rawline) . "\n";
my $msg_level = \&ERROR;
$msg_level = \&CHK if ($file);
&{$msg_level}("FSF_MAILING_ADDRESS",
"Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL.\n" . $herevet)
}

# check for Kconfig help text having a real description
# Only applies when adding the entry originally, after that we do not have
# sufficient context to determine whether it is indeed long enough.
Expand Down Expand Up @@ -4058,7 +4046,12 @@ sub process {
# likely a typedef for a function.
} elsif ($ctx =~ /$Type$/) {

} else {
# All-uppercase function names are usually macros,
# ignore those
} elsif ($name eq uc $name) {

}
else {
if (WARN("SPACING",
"space prohibited between function name and open parenthesis '('\n" . $herecurr) &&
$fix) {
Expand Down

0 comments on commit f2a010f

Please sign in to comment.