mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: version: remove trailing new line from version_string
@ 2023-10-10 11:59 Ahmad Fatoum
  2023-10-10 14:25 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-10-10 11:59 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

For determining the barebox version, the variables version_string,
release_string and buildsystem_version_string are exported for general
use. Only version_string is given a trailing new line though.

The trailing new line can be unexpected and is something that should
be added by code that requires it, so drop it from the variable
definition itself.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 commands/version.c | 2 +-
 common/version.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commands/version.c b/commands/version.c
index 764c20876703..0ad8e587de87 100644
--- a/commands/version.c
+++ b/commands/version.c
@@ -7,7 +7,7 @@
 
 static int do_version(int argc, char *argv[])
 {
-	printf ("\n%s\n", version_string);
+	printf ("\n%s\n\n", version_string);
 	return 0;
 }
 
diff --git a/common/version.c b/common/version.c
index 15f03c2a00ff..465e22c7f52e 100644
--- a/common/version.c
+++ b/common/version.c
@@ -5,7 +5,7 @@
 #include <generated/utsrelease.h>
 
 const char version_string[] =
-	"barebox " UTS_RELEASE " " UTS_VERSION "\n";
+	"barebox " UTS_RELEASE " " UTS_VERSION;
 EXPORT_SYMBOL(version_string);
 
 const char release_string[] =
@@ -20,7 +20,7 @@ EXPORT_SYMBOL(buildsystem_version_string);
 void barebox_banner (void)
 {
 	printf("\n\n");
-	pr_info("%s", version_string);
+	pr_info("%s\n", version_string);
 	if (strlen(buildsystem_version_string) > 0)
 		pr_info("Buildsystem version: %s", buildsystem_version_string);
 	printf("\n\n");
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] common: version: remove trailing new line from version_string
  2023-10-10 11:59 [PATCH] common: version: remove trailing new line from version_string Ahmad Fatoum
@ 2023-10-10 14:25 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-10-10 14:25 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Tue, Oct 10, 2023 at 01:59:06PM +0200, Ahmad Fatoum wrote:
> For determining the barebox version, the variables version_string,
> release_string and buildsystem_version_string are exported for general
> use. Only version_string is given a trailing new line though.
> 
> The trailing new line can be unexpected and is something that should
> be added by code that requires it, so drop it from the variable
> definition itself.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  commands/version.c | 2 +-
>  common/version.c   | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/commands/version.c b/commands/version.c
> index 764c20876703..0ad8e587de87 100644
> --- a/commands/version.c
> +++ b/commands/version.c
> @@ -7,7 +7,7 @@
>  
>  static int do_version(int argc, char *argv[])
>  {
> -	printf ("\n%s\n", version_string);
> +	printf ("\n%s\n\n", version_string);
>  	return 0;
>  }
>  
> diff --git a/common/version.c b/common/version.c
> index 15f03c2a00ff..465e22c7f52e 100644
> --- a/common/version.c
> +++ b/common/version.c
> @@ -5,7 +5,7 @@
>  #include <generated/utsrelease.h>
>  
>  const char version_string[] =
> -	"barebox " UTS_RELEASE " " UTS_VERSION "\n";
> +	"barebox " UTS_RELEASE " " UTS_VERSION;
>  EXPORT_SYMBOL(version_string);
>  
>  const char release_string[] =
> @@ -20,7 +20,7 @@ EXPORT_SYMBOL(buildsystem_version_string);
>  void barebox_banner (void)
>  {
>  	printf("\n\n");
> -	pr_info("%s", version_string);
> +	pr_info("%s\n", version_string);
>  	if (strlen(buildsystem_version_string) > 0)
>  		pr_info("Buildsystem version: %s", buildsystem_version_string);
>  	printf("\n\n");
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-10 14:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10 11:59 [PATCH] common: version: remove trailing new line from version_string Ahmad Fatoum
2023-10-10 14:25 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox