]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: add non-32 bit atomic warning to checkpatch
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 19 Nov 2018 18:48:42 +0000 (18:48 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 19 Nov 2018 19:03:45 +0000 (19:03 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
tools/checkpatch.pl

index 22354c1e882b72478a5e31ce6db1dac89fa22794..547a4b21370e4ca01157eb49855545b1045d5b4f 100755 (executable)
@@ -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