summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-11-19 18:48:42 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-11-19 19:03:45 +0000
commit11b5117007a8a83f08a0dd8baf4aeaacfd1b50ed (patch)
tree0dfcdd42232257dc505b04e8b6c95ec50143118a
parent0545c3738438dedbbec4650b5c0e4aa28a1b38ef (diff)
tools: add non-32 bit atomic warning to checkpatch
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rwxr-xr-xtools/checkpatch.pl7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/checkpatch.pl b/tools/checkpatch.pl
index 22354c1e88..547a4b2137 100755
--- a/tools/checkpatch.pl
+++ b/tools/checkpatch.pl
@@ -6367,6 +6367,13 @@ sub process {
ERROR("NONSTANDARD_INTEGRAL_TYPES",
"Please, no nonstandard integer types in new code.\n" . $herecurr)
}
+
+# check for usage of non-32 bit atomics
+ if ($line =~ /_Atomic [u]?int(?!32)[0-9]+_t/) {
+ WARN("NON_32BIT_ATOMIC",
+ "Please, only use 32 bit atomics.\n" . $herecurr);
+ }
+
}
# If we have no input at all, then there is nothing to report on