Browse Source

version: Move version_string[] from version.h to version_string.h

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 <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Pali Rohár 2 years ago
parent
commit
bdfb6d70bb

+ 1 - 1
board/ge/b1x5v2/b1x5v2.c

@@ -30,7 +30,7 @@
 #include <panel.h>
 #include <rtc.h>
 #include <spi_flash.h>
-#include <version.h>
+#include <version_string.h>
 
 #include "../common/vpd_reader.h"
 

+ 1 - 1
board/ge/bx50v3/bx50v3.c

@@ -34,7 +34,7 @@
 #include <power/pmic.h>
 #include <input.h>
 #include <pwm.h>
-#include <version.h>
+#include <version_string.h>
 #include <stdlib.h>
 #include <dm/root.h>
 #include "../common/ge_rtc.h"

+ 1 - 1
board/ge/mx53ppd/mx53ppd.c

@@ -33,7 +33,7 @@
 #include <fsl_pmic.h>
 #include <linux/fb.h>
 #include <ipu_pixfmt.h>
-#include <version.h>
+#include <version_string.h>
 #include <watchdog.h>
 #include "ppd_gpio.h"
 #include <stdlib.h>

+ 1 - 0
cmd/version.c

@@ -7,6 +7,7 @@
 #include <common.h>
 #include <command.h>
 #include <version.h>
+#include <version_string.h>
 #include <linux/compiler.h>
 #ifdef CONFIG_SYS_COREBOOT
 #include <asm/cb_sysinfo.h>

+ 1 - 1
common/main.c

@@ -15,7 +15,7 @@
 #include <env.h>
 #include <init.h>
 #include <net.h>
-#include <version.h>
+#include <version_string.h>
 #include <efi_loader.h>
 
 static void run_preboot_environment_command(void)

+ 1 - 2
drivers/video/cfb_console.c

@@ -71,7 +71,7 @@
 #include <fdtdec.h>
 #include <gzip.h>
 #include <log.h>
-#include <version.h>
+#include <version_string.h>
 #include <malloc.h>
 #include <video.h>
 #include <asm/global_data.h>
@@ -108,7 +108,6 @@
  * Console device
  */
 
-#include <version.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
 #include <video_font.h>

+ 0 - 3
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__ */

+ 8 - 0
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__ */

+ 1 - 1
lib/display_options.c

@@ -8,7 +8,7 @@
 #include <compiler.h>
 #include <console.h>
 #include <div64.h>
-#include <version.h>
+#include <version_string.h>
 #include <linux/ctype.h>
 #include <asm/io.h>
 

+ 1 - 1
lib/efi_loader/efi_tcg2.c

@@ -14,7 +14,7 @@
 #include <efi_tcg2.h>
 #include <log.h>
 #include <malloc.h>
-#include <version.h>
+#include <version_string.h>
 #include <tpm-v2.h>
 #include <u-boot/hash-checksum.h>
 #include <u-boot/sha1.h>

+ 1 - 1
test/print_ut.c

@@ -9,7 +9,7 @@
 #include <display_options.h>
 #include <log.h>
 #include <mapmem.h>
-#include <version.h>
+#include <version_string.h>
 #include <test/suites.h>
 #include <test/test.h>
 #include <test/ut.h>