mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] common: version: remove trailing new line from version_string
Date: Tue, 10 Oct 2023 16:25:13 +0200	[thread overview]
Message-ID: <20231010142513.GE3114228@pengutronix.de> (raw)
In-Reply-To: <20231010115906.3297847-1-a.fatoum@pengutronix.de>

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 |



      reply	other threads:[~2023-10-10 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 11:59 Ahmad Fatoum
2023-10-10 14:25 ` Sascha Hauer [this message]

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=20231010142513.GE3114228@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=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