diff mbox series

[1/2] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR)

Message ID 20200901104234.92159-2-f4bug@amsat.org
State New
Headers show
Series [1/2] hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR) | expand

Commit Message

Philippe Mathieu-Daudé Sept. 1, 2020, 10:42 a.m. UTC
Replace fprintf() by qemu_log_mask(LOG_GUEST_ERROR).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/gpio/omap_gpio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Laurent Vivier Sept. 2, 2020, 9:15 a.m. UTC | #1
Le 01/09/2020 à 12:42, Philippe Mathieu-Daudé a écrit :
> Replace fprintf() by qemu_log_mask(LOG_GUEST_ERROR).
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/gpio/omap_gpio.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
> index f662c4cb958..e25084b40c9 100644
> --- a/hw/gpio/omap_gpio.c
> +++ b/hw/gpio/omap_gpio.c
> @@ -392,8 +392,10 @@ static void omap2_gpio_module_write(void *opaque, hwaddr addr,
>          break;
>  
>      case 0x10:	/* GPIO_SYSCONFIG */
> -        if (((value >> 3) & 3) == 3)
> -            fprintf(stderr, "%s: bad IDLEMODE value\n", __func__);
> +        if (((value >> 3) & 3) == 3) {
> +            qemu_log_mask(LOG_GUEST_ERROR,
> +                          "%s: Illegal IDLEMODE value: 3\n", __func__);
> +        }
>          if (value & 2)
>              omap2_gpio_module_reset(s);
>          s->config[0] = value & 0x1d;
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox series

Patch

diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index f662c4cb958..e25084b40c9 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -392,8 +392,10 @@  static void omap2_gpio_module_write(void *opaque, hwaddr addr,
         break;
 
     case 0x10:	/* GPIO_SYSCONFIG */
-        if (((value >> 3) & 3) == 3)
-            fprintf(stderr, "%s: bad IDLEMODE value\n", __func__);
+        if (((value >> 3) & 3) == 3) {
+            qemu_log_mask(LOG_GUEST_ERROR,
+                          "%s: Illegal IDLEMODE value: 3\n", __func__);
+        }
         if (value & 2)
             omap2_gpio_module_reset(s);
         s->config[0] = value & 0x1d;