Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Marco Elver and committed by
Peter Zijlstra
25d3b21e 8f32441d

+7
+7
scripts/checkpatch.pl
··· 6733 6733 } 6734 6734 } 6735 6735 6736 + # check for context_unsafe without a comment. 6737 + if ($line =~ /\bcontext_unsafe\b/ && 6738 + !ctx_has_comment($first_line, $linenr)) { 6739 + WARN("CONTEXT_UNSAFE", 6740 + "context_unsafe without comment\n" . $herecurr); 6741 + } 6742 + 6736 6743 # check of hardware specific defines 6737 6744 if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { 6738 6745 CHK("ARCH_DEFINES",