[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] hw/core/register.c: Don't use '#' flag of printf format
From: |
Alistair Francis |
Subject: |
Re: [PATCH] hw/core/register.c: Don't use '#' flag of printf format |
Date: |
Thu, 19 Nov 2020 11:50:25 -0800 |
On Mon, Nov 16, 2020 at 6:07 AM Xinhao Zhang <zhangxinhao1@huawei.com> wrote:
>
> Fix code style. Don't use '#' flag of printf format ('%#') in
> format strings, use '0x' prefix instead
>
> Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
> Signed-off-by: Kai Deng <dengkai1@huawei.com>
Thanks for the patch!
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
I'm going to take this via the RISC-V tree when the 6.0 development
process starts.
Alistair
> ---
> hw/core/register.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/core/register.c b/hw/core/register.c
> index 31038bd7cc..7986913130 100644
> --- a/hw/core/register.c
> +++ b/hw/core/register.c
> @@ -80,7 +80,7 @@ void register_write(RegisterInfo *reg, uint64_t val,
> uint64_t we,
>
> if (!ac || !ac->name) {
> qemu_log_mask(LOG_GUEST_ERROR, "%s: write to undefined device state "
> - "(written value: %#" PRIx64 ")\n", prefix, val);
> + "(written value: 0x%" PRIx64 ")\n", prefix, val);
> return;
> }
>
> @@ -89,14 +89,14 @@ void register_write(RegisterInfo *reg, uint64_t val,
> uint64_t we,
> test = (old_val ^ val) & ac->rsvd;
> if (test) {
> qemu_log_mask(LOG_GUEST_ERROR, "%s: change of value in reserved bit"
> - "fields: %#" PRIx64 ")\n", prefix, test);
> + "fields: 0x%" PRIx64 ")\n", prefix, test);
> }
>
> test = val & ac->unimp;
> if (test) {
> qemu_log_mask(LOG_UNIMP,
> - "%s:%s writing %#" PRIx64 " to unimplemented bits:" \
> - " %#" PRIx64 "\n",
> + "%s:%s writing 0x%" PRIx64 " to unimplemented bits:" \
> + " 0x%" PRIx64 "\n",
> prefix, reg->access->name, val, ac->unimp);
> }
>
> @@ -112,7 +112,7 @@ void register_write(RegisterInfo *reg, uint64_t val,
> uint64_t we,
> }
>
> if (debug) {
> - qemu_log("%s:%s: write of value %#" PRIx64 "\n", prefix, ac->name,
> + qemu_log("%s:%s: write of value 0x%" PRIx64 "\n", prefix, ac->name,
> new_val);
> }
>
> @@ -150,7 +150,7 @@ uint64_t register_read(RegisterInfo *reg, uint64_t re,
> const char* prefix,
> }
>
> if (debug) {
> - qemu_log("%s:%s: read of value %#" PRIx64 "\n", prefix,
> + qemu_log("%s:%s: read of value 0x%" PRIx64 "\n", prefix,
> ac->name, ret);
> }
>
> @@ -193,7 +193,7 @@ void register_write_memory(void *opaque, hwaddr addr,
>
> if (!reg) {
> qemu_log_mask(LOG_GUEST_ERROR, "%s: write to unimplemented register
> " \
> - "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
> + "at address: 0x%" PRIx64 "\n", reg_array->prefix,
> addr);
> return;
> }
>
> @@ -222,7 +222,7 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
>
> if (!reg) {
> qemu_log_mask(LOG_GUEST_ERROR, "%s: read to unimplemented register
> " \
> - "at address: %#" PRIx64 "\n", reg_array->prefix, addr);
> + "at address: 0x%" PRIx64 "\n", reg_array->prefix,
> addr);
> return 0;
> }
>
> --
> 2.29.0-rc1
>
>