diff options
| author | Jonathan Corbet <corbet@lwn.net> | 2022-09-29 22:29:16 +0300 |
|---|---|---|
| committer | Jonathan Corbet <corbet@lwn.net> | 2022-09-29 22:29:16 +0300 |
| commit | 05fff6ba04eef8b88bb94734b66731bef3d8d34b (patch) | |
| tree | 9a51efe350c52c256396777f367c766a909ddb8c /scripts/checkpatch.pl | |
| parent | 3ef859a4f6c97253b75eb53d259b7789fb92d875 (diff) | |
| parent | 69d517e6e21099f81efbd39e47874649ae575804 (diff) | |
| download | linux-05fff6ba04eef8b88bb94734b66731bef3d8d34b.tar.xz | |
Merge branch 'docs-mw' into docs-next
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 79e759aac543..4aa09e0cb86a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3751,7 +3751,7 @@ sub process { if ($realfile =~ /\.S$/ && $line =~ /^\+\s*(?:[A-Z]+_)?SYM_[A-Z]+_(?:START|END)(?:_[A-Z_]+)?\s*\(\s*\.L/) { WARN("AVOID_L_PREFIX", - "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/asm-annotations.rst\n" . $herecurr); + "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/core-api/asm-annotations.rst\n" . $herecurr); } # check we are in a valid source file C or perl if not then ignore this hunk @@ -4695,12 +4695,12 @@ sub process { } } -# avoid BUG() or BUG_ON() - if ($line =~ /\b(?:BUG|BUG_ON)\b/) { +# do not use BUG() or variants + if ($line =~ /\b(?!AA_|BUILD_|DCCP_|IDA_|KVM_|RWLOCK_|snd_|SPIN_)(?:[a-zA-Z_]*_)?BUG(?:_ON)?(?:_[A-Z_]+)?\s*\(/) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file); &{$msg_level}("AVOID_BUG", - "Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()\n" . $herecurr); + "Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants\n" . $herecurr); } # avoid LINUX_VERSION_CODE |
