On Wed, 23 Apr 2025 at 20:39, Daniel Henrique Barboza
<dbarb...@ventanamicro.com> wrote:
>
> We can avoid the 'long' casts by using PRIx64 and HWADDR_PRIx on the fmt
> strings for uint64_t and hwaddr types.
>
> Signed-off-by: Daniel Henrique Barboza <dbarb...@ventanamicro.com>
> ---
>  hw/riscv/virt.c | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 036a0a9bfb..075c035f25 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -309,7 +309,7 @@ static void create_fdt_socket_memory(RISCVVirtState *s, 
> int socket)
>
>      addr = s->memmap[VIRT_DRAM].base + riscv_socket_mem_offset(ms, socket);
>      size = riscv_socket_mem_size(ms, socket);
> -    mem_name = g_strdup_printf("/memory@%lx", (long)addr);
> +    mem_name = g_strdup_printf("/memory@%"PRIx64, addr);

I wondered why this wasn't a HWADDR_PRIx.

addr (and NodeInfo::node_mem?) could be a hwaddr? That would make
everything more consistent.

Cheers,

Joel

Reply via email to