From: Joe Perches Date: Fri, 13 Feb 2015 22:38:18 +0000 (-0800) Subject: checkpatch: emit an error when using predefined timestamp macros X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=62ec818f55ccc3e1a04a6634f8e541596778af5d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git checkpatch: emit an error when using predefined timestamp macros Since commit fe7c36c7bde1 ("Makefile: Build with -Werror=date-time if the compiler supports it"), use of __DATE__, __TIME__, and __TIMESTAMP__ has not been allowed. As this test is gcc version specific (> 4.9), it hasn't prevented a few new uses from creeping into the kernel sources. Make checkpatch complain about them. Signed-off-by: Joe Perches Original-patch-by: Rasmus Villemoes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0bb6d60c07b..501c286369c9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5089,6 +5089,12 @@ sub process { } } +# check for uses of __DATE__, __TIME__, __TIMESTAMP__ + while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) { + ERROR("DATE_TIME", + "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr); + } + # check for use of yield() if ($line =~ /\byield\s*\(\s*\)/) { WARN("YIELD",