From: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,
Tom Rini <trini@konsulko.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
Raymond Mao <raymond.mao@linaro.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Simon Glass <sjg@chromium.org>,
Caleb Connolly <caleb.connolly@linaro.org>,
Marek Vasut <marex@denx.de>, <u-boot@lists.denx.de>
Subject: Re: [PATCH v2 3/4] lib: uuid: fix uuid_str_to_bin() on 32-bit
Date: Tue, 12 Nov 2024 11:52:43 +0100 [thread overview]
Message-ID: <40bfaf76-e65c-46de-a4bb-430423f7bb44@foss.st.com> (raw)
In-Reply-To: <20241103224223.195255-4-heinrich.schuchardt@canonical.com>
On 11/3/24 23:42, Heinrich Schuchardt wrote:
> hextoul() cannot convert a string to a 64-bit number on a 32-bit system.
> Use function hextoull() instead.
>
> Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
> Fixes: 22c48a92cdce ("lib: uuid: supporting building as part of host tools")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> v2:
> new patch
> ---
> lib/uuid.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/uuid.c b/lib/uuid.c
> index 19f33dd1477..538a1ba6aa8 100644
> --- a/lib/uuid.c
> +++ b/lib/uuid.c
> @@ -313,7 +313,7 @@ int uuid_str_to_bin(const char *uuid_str, unsigned char *uuid_bin,
> tmp16 = cpu_to_be16(hextoul(uuid_str + 19, NULL));
> memcpy(uuid_bin + 8, &tmp16, 2);
>
> - tmp64 = cpu_to_be64(hextoul(uuid_str + 24, NULL));
> + tmp64 = cpu_to_be64(hextoull(uuid_str + 24, NULL));
> memcpy(uuid_bin + 10, (char *)&tmp64 + 2, 6);
>
> return 0;
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Thanks
Patrick
next prev parent reply other threads:[~2024-11-12 10:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-03 22:42 [PATCH v2 0/4] lib: uuid: fix uuid_str_to_le_bin() on 32-bit Heinrich Schuchardt
2024-11-03 22:42 ` [PATCH v2 1/4] lib: provide function hextoull() Heinrich Schuchardt
2024-11-07 9:45 ` Ilias Apalodimas
2024-11-07 10:51 ` Marek Vasut
2024-11-12 11:00 ` Patrick DELAUNAY
2024-11-13 13:39 ` Simon Glass
2024-11-13 14:12 ` Tom Rini
2024-11-13 14:42 ` Simon Glass
2024-11-13 15:19 ` Tom Rini
2024-11-03 22:42 ` [PATCH v2 2/4] lib: uuid: fix uuid_str_to_le_bin() on 32-bit Heinrich Schuchardt
2024-11-06 10:42 ` Caleb Connolly
2024-11-11 12:34 ` Ilias Apalodimas
2024-11-12 10:51 ` Patrick DELAUNAY
2024-11-03 22:42 ` [PATCH v2 3/4] lib: uuid: fix uuid_str_to_bin() " Heinrich Schuchardt
2024-11-06 10:42 ` Caleb Connolly
2024-11-11 12:33 ` Ilias Apalodimas
2024-11-12 10:52 ` Patrick DELAUNAY [this message]
2024-11-03 22:42 ` [PATCH v2 4/4] configs: enable UNIT_TEST on qemu_arm_defconfig Heinrich Schuchardt
2024-11-03 22:46 ` Tom Rini
2024-11-07 9:52 ` Ilias Apalodimas
2024-11-12 11:00 ` Patrick DELAUNAY
2024-11-13 17:40 ` [PATCH v2 0/4] lib: uuid: fix uuid_str_to_le_bin() on 32-bit Tom Rini
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=40bfaf76-e65c-46de-a4bb-430423f7bb44@foss.st.com \
--to=patrick.delaunay@foss.st.com \
--cc=caleb.connolly@linaro.org \
--cc=heinrich.schuchardt@canonical.com \
--cc=ilias.apalodimas@linaro.org \
--cc=marex@denx.de \
--cc=raymond.mao@linaro.org \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=tuomas.tynkkynen@iki.fi \
--cc=u-boot@lists.denx.de \
/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