public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Add exceptions for dsb keyword usage
@ 2018-07-05 18:19 Prakruthi Deepak Heragu
  2018-07-05 21:14 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Prakruthi Deepak Heragu @ 2018-07-05 18:19 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-kernel, ckadabi, tsoni, bryanh, Prakruthi Deepak Heragu

mb() API can relpace the dsb() API in the kernel code. So, dsb() usage
is discouraged. However, there are exceptions when dsb is used in a
variable or a function name. Exceptions are when 'dsb' is prefixed with
class [-_>*\.] and/or suffixed with class [-_\.;].

Signed-off-by: Prakruthi Deepak Heragu <pheragu@codeaurora.org>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a9c0550..978c752 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5372,6 +5372,12 @@ sub process {
 			     "Avoid line continuations in quoted strings\n" . $herecurr);
 		}
 
+# dsb is too ARMish, and should usually be mb.
+        if ($line =~ /[^-_>*\.]\bdsb\b[^-_\.;]/) {
+            WARN("ARM_BARRIER",
+                 "Use of dsb is discouranged: prefer mb.\n" .
+                 $herecurr);
+		}
 # warn about #if 0
 		if ($line =~ /^.\s*\#\s*if\s+0\b/) {
 			CHK("REDUNDANT_CODE",
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

end of thread, other threads:[~2018-07-06 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 18:19 [PATCH] checkpatch: Add exceptions for dsb keyword usage Prakruthi Deepak Heragu
2018-07-05 21:14 ` Joe Perches
2018-07-06  5:45   ` Mark Rutland
2018-07-06  5:52     ` Joe Perches
2018-07-06 17:00       ` pheragu
2018-07-06 17:02     ` pheragu

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