public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de
Subject: [PATCH] version: Move version_string[] from version.h to version_string.h
Date: Wed, 27 Jan 2021 16:56:30 +0100	[thread overview]
Message-ID: <20210127155630.30375-1-pali@kernel.org> (raw)

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>
---
 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 +-
 test/print_ut.c             | 2 +-
 10 files changed, 16 insertions(+), 11 deletions(-)
 create mode 100644 include/version_string.h

diff --git a/board/ge/b1x5v2/b1x5v2.c b/board/ge/b1x5v2/b1x5v2.c
index 1cb347fd9e..18ba5c9e71 100644
--- a/board/ge/b1x5v2/b1x5v2.c
+++ b/board/ge/b1x5v2/b1x5v2.c
@@ -29,7 +29,7 @@
 #include <panel.h>
 #include <rtc.h>
 #include <spi_flash.h>
-#include <version.h>
+#include <version_string.h>
 
 #include "../common/vpd_reader.h"
 
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index 3ea9425fd1..faad9cef72 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -32,7 +32,7 @@
 #include <power/da9063_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"
diff --git a/board/ge/mx53ppd/mx53ppd.c b/board/ge/mx53ppd/mx53ppd.c
index ef689733c4..9a76cdc388 100644
--- a/board/ge/mx53ppd/mx53ppd.c
+++ b/board/ge/mx53ppd/mx53ppd.c
@@ -32,7 +32,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>
diff --git a/cmd/version.c b/cmd/version.c
index 3686b87332..b183cc8b63 100644
--- a/cmd/version.c
+++ b/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/arch/sysinfo.h>
diff --git a/common/main.c b/common/main.c
index ae5bcdb32f..3f5214fd44 100644
--- a/common/main.c
+++ b/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)
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 3f07f4eb29..1a471ce07b 100644
--- a/drivers/video/cfb_console.c
+++ b/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 <linux/compiler.h>
@@ -121,7 +121,6 @@
  * Console device
  */
 
-#include <version.h>
 #include <linux/types.h>
 #include <stdio_dev.h>
 #include <video_font.h>
diff --git a/include/version.h b/include/version.h
index 2d24451569..0a3b29adb8 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 0000000000..a89a6e4370
--- /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 b2025eeb5c..1b069761f8 100644
--- a/lib/display_options.c
+++ b/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>
 
diff --git a/test/print_ut.c b/test/print_ut.c
index a456a449ef..ae1cf85f1c 100644
--- a/test/print_ut.c
+++ b/test/print_ut.c
@@ -12,7 +12,7 @@
 #endif
 #include <display_options.h>
 #include <log.h>
-#include <version.h>
+#include <version_string.h>
 
 #define FAKE_BUILD_TAG	"jenkins-u-boot-denx_uboot_dm-master-build-aarch64" \
 			"and a lot more text to come"
-- 
2.20.1

             reply	other threads:[~2021-01-27 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 15:56 Pali Rohár [this message]
2021-02-01 20:43 ` [PATCH] version: Move version_string[] from version.h to version_string.h Simon Glass
2021-02-02 14:56 ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210127155630.30375-1-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox