[PATCH-for-5.2 2/4] hw/display/cirrus_vga: Fix hexadecimal format string specifier

Philippe Mathieu-Daudé posted 4 patches 5 years, 3 months ago
[PATCH-for-5.2 2/4] hw/display/cirrus_vga: Fix hexadecimal format string specifier
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
The '%u' conversion specifier is for decimal notation.
When prefixing a format with '0x', we want the hexadecimal
specifier ('%x').

Inspired-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/display/cirrus_vga.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index e14096deb46..fdca6ca659f 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -2105,7 +2105,7 @@ static void cirrus_vga_mem_write(void *opaque,
     } else {
         qemu_log_mask(LOG_GUEST_ERROR,
                       "cirrus: mem_writeb 0x" TARGET_FMT_plx " "
-                      "value 0x%02" PRIu64 "\n", addr, mem_value);
+                      "value 0x%02" PRIx64 "\n", addr, mem_value);
     }
 }
 
-- 
2.26.2

Re: [PATCH-for-5.2 2/4] hw/display/cirrus_vga: Fix hexadecimal format string specifier
Posted by Dr. David Alan Gilbert 5 years, 3 months ago
* Philippe Mathieu-Daudé (philmd@redhat.com) wrote:
> The '%u' conversion specifier is for decimal notation.
> When prefixing a format with '0x', we want the hexadecimal
> specifier ('%x').
> 
> Inspired-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Oh that's nice, one my regex wouldn't find.


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  hw/display/cirrus_vga.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index e14096deb46..fdca6ca659f 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -2105,7 +2105,7 @@ static void cirrus_vga_mem_write(void *opaque,
>      } else {
>          qemu_log_mask(LOG_GUEST_ERROR,
>                        "cirrus: mem_writeb 0x" TARGET_FMT_plx " "
> -                      "value 0x%02" PRIu64 "\n", addr, mem_value);
> +                      "value 0x%02" PRIx64 "\n", addr, mem_value);
>      }
>  }
>  
> -- 
> 2.26.2
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK


Re: [PATCH-for-5.2 2/4] hw/display/cirrus_vga: Fix hexadecimal format string specifier
Posted by Philippe Mathieu-Daudé 5 years, 3 months ago
Hi Gerd,

On 11/3/20 12:25 PM, Philippe Mathieu-Daudé wrote:
> The '%u' conversion specifier is for decimal notation.
> When prefixing a format with '0x', we want the hexadecimal
> specifier ('%x').
> 
> Inspired-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/display/cirrus_vga.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index e14096deb46..fdca6ca659f 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -2105,7 +2105,7 @@ static void cirrus_vga_mem_write(void *opaque,
>      } else {
>          qemu_log_mask(LOG_GUEST_ERROR,
>                        "cirrus: mem_writeb 0x" TARGET_FMT_plx " "
> -                      "value 0x%02" PRIu64 "\n", addr, mem_value);
> +                      "value 0x%02" PRIx64 "\n", addr, mem_value);
>      }
>  }
>  
> 

This patch (and previous one) missed your latest ui pull
request. As there is no qemu-trivial@ pull request during
freeze/rc, can you queue these patches via your tree?

Thanks,

Phil.