[PATCH] common: version: remove trailing new line from version_string

Sascha Hauer sha at pengutronix.de
Tue Oct 10 07:25:13 PDT 2023


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 at 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 |



More information about the barebox mailing list