]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scripts/kernel-doc: Fix build time warnings
authorAndré Almeida <andrealmeid@igalia.com>
Thu, 10 Oct 2024 22:59:33 +0000 (19:59 -0300)
committerJonathan Corbet <corbet@lwn.net>
Mon, 14 Oct 2024 15:51:38 +0000 (09:51 -0600)
As stated at Documentation/kbuild/llvm.rst, to make usage of ccache one
must set KBUILD_BUILD_TIMESTAMP=''. Setting this together with W=1
will trigger the following warning for every compiled file:

  date: invalid date ‘+%s’

This comes from kernel-doc script, that produces the following command
when KBUILD_BUILD_TIMESTAMP is empty:

  date -d"" +%s

That triggers the warning above. Add a space between the flag `-d` and
the string argument to fix date command and remove the warning.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20241010225933.166436-1-andrealmeid@igalia.com
scripts/kernel-doc

index 2791f81952038789d7127fe425b999a9e7547e36..8728f9824c65a2c6eef8459e3429e96f04fc2a7b 100755 (executable)
@@ -160,7 +160,7 @@ my @export_file_list;
 
 my @build_time;
 if (defined($ENV{'KBUILD_BUILD_TIMESTAMP'}) &&
-    (my $seconds = `date -d"${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') {
+    (my $seconds = `date -d "${ENV{'KBUILD_BUILD_TIMESTAMP'}}" +%s`) ne '') {
     @build_time = gmtime($seconds);
 } else {
     @build_time = localtime;