public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] checkpatch: Check for use of disallowed macros
@ 2014-12-12 10:51 Rasmus Villemoes
  2014-12-12 10:51 ` [PATCH 2/3] staging: unisys: remove leftover __DATE__ Rasmus Villemoes
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Rasmus Villemoes @ 2014-12-12 10:51 UTC (permalink / raw)
  To: Joe Perches; +Cc: Rasmus Villemoes, linux-kernel

Since fe7c36c7 ("Makefile: Build with -Werror=date-time if the
compiler supports it"), use of __DATE__, __TIME__, __TIMESTAMP__ has
been disallowed. This hasn't prevented a few new users from creeping
in. Make checkpatch complain.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f0bb6d60c07b..7fafd3b45539 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3008,6 +3008,12 @@ sub process {
 		$line =~ s@//.*@@;
 		$opline =~ s@//.*@@;
 
+
+# Use of __DATE__, __TIME__, __TIMESTAMP__ is not allowed
+		if ($line =~ m/\b__(?:DATE|TIME|TIMESTAMP)__\b/) {
+		    ERROR("DATETIME", "Do not use the macros __DATE__, __TIME__ and __TIMESTAMP__\n" . $herecurr)
+		}
+
 # EXPORT_SYMBOL should immediately follow the thing it is exporting, consider
 # the whole statement.
 #print "APW <$lines[$realline_next - 1]>\n";
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-01-13  5:42 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-12 10:51 [PATCH 1/3] checkpatch: Check for use of disallowed macros Rasmus Villemoes
2014-12-12 10:51 ` [PATCH 2/3] staging: unisys: remove leftover __DATE__ Rasmus Villemoes
2014-12-12 10:51 ` [PATCH 3/3] ACPICA: Remove use of __DATE__ macro Rasmus Villemoes
2015-01-05  8:47   ` Zheng, Lv
2015-01-05 10:26     ` Rasmus Villemoes
2015-01-06  0:30       ` Zheng, Lv
2015-01-06 19:36         ` [Devel] " David E. Box
2015-01-13  2:33           ` Zheng, Lv
2015-01-13  5:42             ` Zheng, Lv
2014-12-12 11:16 ` [PATCH 1/3] checkpatch: Check for use of disallowed macros Joe Perches
2014-12-18 21:15   ` Rasmus Villemoes
2014-12-18 21:26     ` Joe Perches
2014-12-18 22:17       ` checkpatch: Emit an error when using predefined timestamp macros Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox