From bdfb6d70bb45da6e31785171fed70cb93b0ff36b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Mon, 2 Aug 2021 15:18:31 +0200 Subject: [PATCH] version: Move version_string[] from version.h to version_string.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit More C files do not use compile time timestamp macros and do not have to be recompiled every time when SOURCE_DATE_EPOCH changes. This patch moves version_string[] from version.h to version_string.h and updates other C files which only needs version_string[] string to include version_string.h instead of version.h. After applying this patch these files are not recompiled every time when SOURCE_DATE_EPOCH changes. Signed-off-by: Pali Rohár Reviewed-by: Tom Rini --- board/ge/b1x5v2/b1x5v2.c | 2 +- board/ge/bx50v3/bx50v3.c | 2 +- board/ge/mx53ppd/mx53ppd.c | 2 +- cmd/version.c | 1 + common/main.c | 2 +- drivers/video/cfb_console.c | 3 +-- include/version.h | 3 --- include/version_string.h | 8 ++++++++ lib/display_options.c | 2 +- lib/efi_loader/efi_tcg2.c | 2 +- test/print_ut.c | 2 +- 11 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 include/version_string.h diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c index de4cb0d..a2cbd15 100644 --- a/board/ge/b1x5v2/b1x5v2.c +++ b/board/ge/b1x5v2/b1x5v2.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "../common/vpd_reader.h" diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 7fcebba..ed700f4 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include "../common/ge_rtc.h" diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c index 9c48883..cc462d5 100644 --- a/board/ge/mx53ppd/mx53ppd.c +++ b/board/ge/mx53ppd/mx53ppd.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include "ppd_gpio.h" #include diff --git a/cmd/version.c b/cmd/version.c index 685b458..965ac2e 100644 --- a/cmd/version.c +++ b/cmd/version.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #ifdef CONFIG_SYS_COREBOOT #include diff --git a/common/main.c b/common/main.c index ae5bcdb..3f5214f 100644 --- a/common/main.c +++ b/common/main.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include static void run_preboot_environment_command(void) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index 5e1ee06..830ea80 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -71,7 +71,7 @@ #include #include #include -#include +#include #include #include #include @@ -108,7 +108,6 @@ * Console device */ -#include #include #include #include diff --git a/include/version.h b/include/version.h index 2d24451..0a3b29a 100644 --- a/include/version.h +++ b/include/version.h @@ -16,7 +16,4 @@ #define U_BOOT_VERSION_STRING U_BOOT_VERSION " (" U_BOOT_DATE " - " \ U_BOOT_TIME " " U_BOOT_TZ ")" CONFIG_IDENT_STRING -#ifndef __ASSEMBLY__ -extern const char version_string[]; -#endif /* __ASSEMBLY__ */ #endif /* __VERSION_H__ */ diff --git a/include/version_string.h b/include/version_string.h new file mode 100644 index 0000000..a89a6e4 --- /dev/null +++ b/include/version_string.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef __VERSION_STRING_H__ +#define __VERSION_STRING_H__ + +extern const char version_string[]; + +#endif /* __VERSION_STRING_H__ */ diff --git a/lib/display_options.c b/lib/display_options.c index 4da1f52..360b01b 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c index 578b69e..7bacf9c 100644 --- a/lib/efi_loader/efi_tcg2.c +++ b/lib/efi_loader/efi_tcg2.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/print_ut.c b/test/print_ut.c index e2bcfbe..11d8580 100644 --- a/test/print_ut.c +++ b/test/print_ut.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include -- 2.7.4