From: Joe Perches <joe@perches.com>
Date: Wed, 3 Jul 2013 22:05:26 +0000 (-0700)
Subject: checkpatch: warn on comparisons to get_jiffies_64()
X-Git-Tag: firefly_0821_release~176^2~5786^2~230
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9d7a34a5135d29b840d074ba8fbb9c2fac63e508;p=firefly-linux-kernel-4.4.55.git

checkpatch: warn on comparisons to get_jiffies_64()

Comparing get_jiffies_64() is almost always wrong and time_before64 and
time_after64 should be used instead.

Warn on any comparison to get_jiffies_64().

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index c274e1dc1e67..f4e247b277de 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3305,6 +3305,12 @@ sub process {
 			     "Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr);
 		}
 
+# check for comparisons of get_jiffies_64()
+		if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) {
+			WARN("JIFFIES_COMPARISON",
+			     "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr);
+		}
+
 # warn about #ifdefs in C files
 #		if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
 #			print "#ifdef in C files should be avoided\n";