Patchwork qdev: Fix printout of bit device properties with bit index >= 8

login
register
mail settings
Submitter digit@google.com
Date Jan. 10, 2011, 10:11 p.m.
Message ID <1294697500-3706-1-git-send-email-digit@google.com>
Download mbox | patch
Permalink /patch/78254/
State New
Headers show

Comments

digit@google.com - Jan. 10, 2011, 10:11 p.m.
From: David 'Digit' Turner <digit@google.com>

Signed-off-by: David 'Digit' Turner <digit@google.com>
---
 hw/qdev-properties.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Markus Armbruster - Jan. 11, 2011, 9:23 a.m.
digit@google.com writes:

> From: David 'Digit' Turner <digit@google.com>
>
> Signed-off-by: David 'Digit' Turner <digit@google.com>
> ---
>  hw/qdev-properties.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 9219cd7..d5d9591 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -50,7 +50,7 @@ static int parse_bit(DeviceState *dev, Property *prop, const char *str)
>  
>  static int print_bit(DeviceState *dev, Property *prop, char *dest, size_t len)
>  {
> -    uint8_t *p = qdev_get_prop_ptr(dev, prop);
> +    uint32_t *p = qdev_get_prop_ptr(dev, prop);
>      return snprintf(dest, len, (*p & qdev_get_prop_mask(prop)) ? "on" : "off");
>  }

Acked-by: Markus Armbruster <armbru@redhat.com>
Aurelien Jarno - Feb. 20, 2011, 5:54 p.m.
On Mon, Jan 10, 2011 at 11:11:40PM +0100, digit@google.com wrote:
> From: David 'Digit' Turner <digit@google.com>
> 
> Signed-off-by: David 'Digit' Turner <digit@google.com>
> ---
>  hw/qdev-properties.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
> index 9219cd7..d5d9591 100644
> --- a/hw/qdev-properties.c
> +++ b/hw/qdev-properties.c
> @@ -50,7 +50,7 @@ static int parse_bit(DeviceState *dev, Property *prop, const char *str)
>  
>  static int print_bit(DeviceState *dev, Property *prop, char *dest, size_t len)
>  {
> -    uint8_t *p = qdev_get_prop_ptr(dev, prop);
> +    uint32_t *p = qdev_get_prop_ptr(dev, prop);
>      return snprintf(dest, len, (*p & qdev_get_prop_mask(prop)) ? "on" : "off");
>  }
>  

Thanks, applied.

Patch

diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c
index 9219cd7..d5d9591 100644
--- a/hw/qdev-properties.c
+++ b/hw/qdev-properties.c
@@ -50,7 +50,7 @@  static int parse_bit(DeviceState *dev, Property *prop, const char *str)
 
 static int print_bit(DeviceState *dev, Property *prop, char *dest, size_t len)
 {
-    uint8_t *p = qdev_get_prop_ptr(dev, prop);
+    uint32_t *p = qdev_get_prop_ptr(dev, prop);
     return snprintf(dest, len, (*p & qdev_get_prop_mask(prop)) ? "on" : "off");
 }