public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] scripts: checkpatch.pl: remove obsolete in_atomic rule
@ 2017-11-03 19:08 Yang Shi
  2017-11-03 19:41 ` Joe Perches
  2017-11-06 13:52 ` Michal Hocko
  0 siblings, 2 replies; 5+ messages in thread
From: Yang Shi @ 2017-11-03 19:08 UTC (permalink / raw)
  To: apw, joe; +Cc: akpm, Yang Shi, linux-kernel

checkpatch.pl still reports the below in_atomic warning:

WARNING: use of in_atomic() is incorrect outside core kernel code
+       if (in_atomic())

But, in_atomic() has been used outside kernel dir for a long time, and
even drivers. So, remove the obsolete rule even though they can be
ignored.

Signed-off-by: Yang Shi <yang.s@alibaba-inc.com>
CC: Andrew Morton <akpm@linux-foundation.org>
---
Not sure if removing the obsolete rule is preferred by checkpatch.pl, anyway
it sounds not make sense to keep invalid rule.

 scripts/checkpatch.pl | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 8b80bac..e8cf94f 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6231,17 +6231,6 @@ sub process {
 			     "Using $1 should generally have parentheses around the comparison\n" . $herecurr);
 		}
 
-# whine mightly about in_atomic
-		if ($line =~ /\bin_atomic\s*\(/) {
-			if ($realfile =~ m@^drivers/@) {
-				ERROR("IN_ATOMIC",
-				      "do not use in_atomic in drivers\n" . $herecurr);
-			} elsif ($realfile !~ m@^kernel/@) {
-				WARN("IN_ATOMIC",
-				     "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
-			}
-		}
-
 # whine about ACCESS_ONCE
 		if ($^V && $^V ge 5.10.0 &&
 		    $line =~ /\bACCESS_ONCE\s*$balanced_parens\s*(=(?!=))?\s*($FuncArg)?/) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-06 16:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-03 19:08 [RFC PATCH] scripts: checkpatch.pl: remove obsolete in_atomic rule Yang Shi
2017-11-03 19:41 ` Joe Perches
2017-11-03 22:41   ` Yang Shi
2017-11-06 13:52 ` Michal Hocko
2017-11-06 16:08   ` Yang Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox