mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/2] include: common.h: move barebox version/info declarations to new header
Date: Mon,  1 Jul 2024 09:12:23 +0200	[thread overview]
Message-ID: <20240701071223.137695-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240701071223.137695-1-a.fatoum@pengutronix.de>

Including all of common.h just to get the barebox version is overkill.
Let's move the version/info declarations into a separate header that can
be used instead.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/barebox-info.h | 31 +++++++++++++++++++++++++++++++
 include/common.h       | 23 +----------------------
 2 files changed, 32 insertions(+), 22 deletions(-)
 create mode 100644 include/barebox-info.h

diff --git a/include/barebox-info.h b/include/barebox-info.h
new file mode 100644
index 000000000000..446cd0dbaf93
--- /dev/null
+++ b/include/barebox-info.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef __BAREBOX_INFO_H__
+#define __BAREBOX_INFO_H__
+
+#include <linux/types.h>
+
+extern const char version_string[];
+extern const char release_string[];
+extern const char buildsystem_version_string[];
+
+#ifdef CONFIG_BANNER
+void barebox_banner(void);
+#else
+static inline void barebox_banner(void) {}
+#endif
+
+const char *barebox_get_model(void);
+void barebox_set_model(const char *);
+const char *barebox_get_hostname(void);
+void barebox_set_hostname(const char *);
+void barebox_set_hostname_no_overwrite(const char *);
+bool barebox_hostname_is_valid(const char *s);
+
+const char *barebox_get_serial_number(void);
+void barebox_set_serial_number(const char *);
+
+void barebox_set_of_machine_compatible(const char *);
+const char *barebox_get_of_machine_compatible(void);
+
+#endif
diff --git a/include/common.h b/include/common.h
index d7b5261bc921..fb8931c51eb9 100644
--- a/include/common.h
+++ b/include/common.h
@@ -20,6 +20,7 @@
 #include <asm/common.h>
 #include <asm/io.h>
 #include <linux/printk.h>
+#include <barebox-info.h>
 
 /*
  * sanity check. The Linux Kernel defines only one of __LITTLE_ENDIAN and
@@ -113,26 +114,4 @@ int memcpy_parse_options(int argc, char *argv[], int *sourcefd,
 			 int rwsize, int destmode);
 #define RW_BUF_SIZE	(unsigned)4096
 
-extern const char version_string[];
-extern const char release_string[];
-extern const char buildsystem_version_string[];
-#ifdef CONFIG_BANNER
-void barebox_banner(void);
-#else
-static inline void barebox_banner(void) {}
-#endif
-
-const char *barebox_get_model(void);
-void barebox_set_model(const char *);
-const char *barebox_get_hostname(void);
-void barebox_set_hostname(const char *);
-void barebox_set_hostname_no_overwrite(const char *);
-bool barebox_hostname_is_valid(const char *s);
-
-const char *barebox_get_serial_number(void);
-void barebox_set_serial_number(const char *);
-
-void barebox_set_of_machine_compatible(const char *);
-const char *barebox_get_of_machine_compatible(void);
-
 #endif	/* __COMMON_H_ */
-- 
2.39.2




  reply	other threads:[~2024-07-01  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  7:12 [PATCH 1/2] include: gfp: move flags into <linux/gfp.h> Ahmad Fatoum
2024-07-01  7:12 ` Ahmad Fatoum [this message]
2024-07-01 10:09 ` Sascha Hauer

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=20240701071223.137695-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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