diff options
author | Joe Perches <joe@perches.com> | 2013-07-03 18:05:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:07:44 -0400 |
commit | 9d7a34a5135d29b840d074ba8fbb9c2fac63e508 (patch) | |
tree | 3e6869ca31ecf4a1cef0d310427cf937cc1df1cb /scripts/checkpatch.pl | |
parent | 36ec19390effc9131132901e8a66a071a7b74a88 (diff) |
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
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 { | |||
3305 | "Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr); | 3305 | "Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr); |
3306 | } | 3306 | } |
3307 | 3307 | ||
3308 | # check for comparisons of get_jiffies_64() | ||
3309 | if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) { | ||
3310 | WARN("JIFFIES_COMPARISON", | ||
3311 | "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr); | ||
3312 | } | ||
3313 | |||
3308 | # warn about #ifdefs in C files | 3314 | # warn about #ifdefs in C files |
3309 | # if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { | 3315 | # if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { |
3310 | # print "#ifdef in C files should be avoided\n"; | 3316 | # print "#ifdef in C files should be avoided\n"; |