All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Luca Fancellu <Luca.Fancellu@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Wei Chen <Wei.Chen@arm.com>, Wei Liu <wl@xen.org>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: Re: [PATCH] tools/helpers: fix snprintf argument in init-dom0less.c
Date: Mon, 4 Jul 2022 15:32:08 +0000	[thread overview]
Message-ID: <4DB9F3AE-0BCC-45BA-9934-0304FBF84E82@arm.com> (raw)
In-Reply-To: <20220629124938.26498-1-luca.fancellu@arm.com>

Hi Luca,

> On 29 Jun 2022, at 13:49, Luca Fancellu <Luca.Fancellu@arm.com> wrote:
> 
> Fix snprintf argument in init-dom0less.c because two instances of
> the function are using libxl_dominfo struct members that are uint64_t
> types, so change "%lu" to "%"PRIu64 to handle it properly when
> building on arm32 and arm64.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> tools/helpers/init-dom0less.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> index 4c90dd6a0c8f..fee93459c4b9 100644
> --- a/tools/helpers/init-dom0less.c
> +++ b/tools/helpers/init-dom0less.c
> @@ -5,6 +5,7 @@
> #include <stdlib.h>
> #include <sys/mman.h>
> #include <sys/time.h>
> +#include <inttypes.h>
> #include <xenstore.h>
> #include <xenctrl.h>
> #include <xenguest.h>
> @@ -138,10 +139,10 @@ static int create_xenstore(struct xs_handle *xsh,
>                   "vm/" LIBXL_UUID_FMT, LIBXL_UUID_BYTES(uuid));
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
> -    rc = snprintf(max_memkb_str, STR_MAX_LENGTH, "%lu", info->max_memkb);
> +    rc = snprintf(max_memkb_str, STR_MAX_LENGTH, "%"PRIu64, info->max_memkb);
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
> -    rc = snprintf(target_memkb_str, STR_MAX_LENGTH, "%lu", info->current_memkb);
> +    rc = snprintf(target_memkb_str, STR_MAX_LENGTH, "%"PRIu64, info->current_memkb);
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
>     rc = snprintf(ring_ref_str, STR_MAX_LENGTH, "%lld",
> -- 
> 2.17.1
> 



  reply	other threads:[~2022-07-04 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 12:49 [PATCH] tools/helpers: fix snprintf argument in init-dom0less.c Luca Fancellu
2022-07-04 15:32 ` Bertrand Marquis [this message]
2022-07-05  9:51   ` Anthony PERARD

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=4DB9F3AE-0BCC-45BA-9934-0304FBF84E82@arm.com \
    --to=bertrand.marquis@arm.com \
    --cc=Luca.Fancellu@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=anthony.perard@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.