mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
checkpatch: Warn about context_unsafe() without comment
Warn about applications of context_unsafe() without a comment, to encourage documenting the reasoning behind why it was deemed safe. Signed-off-by: Marco Elver <elver@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20251219154418.3592607-6-elver@google.com
This commit is contained in:
parent
8f32441d7a
commit
25d3b21e1d
1 changed files with 7 additions and 0 deletions
|
|
@ -6733,6 +6733,13 @@ sub process {
|
|||
}
|
||||
}
|
||||
|
||||
# check for context_unsafe without a comment.
|
||||
if ($line =~ /\bcontext_unsafe\b/ &&
|
||||
!ctx_has_comment($first_line, $linenr)) {
|
||||
WARN("CONTEXT_UNSAFE",
|
||||
"context_unsafe without comment\n" . $herecurr);
|
||||
}
|
||||
|
||||
# check of hardware specific defines
|
||||
if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) {
|
||||
CHK("ARCH_DEFINES",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue