Patchwork hw/arm_gic.c: Fix improper DPRINTF output.

login
register
mail settings
Submitter Evgeny Voevodin
Date Oct. 2, 2012, 3:50 a.m.
Message ID <1349149837-4821-1-git-send-email-e.voevodin@samsung.com>
Download mbox | patch
Permalink /patch/188382/
State New
Headers show

Comments

Evgeny Voevodin - Oct. 2, 2012, 3:50 a.m.
s->cpu_enabled is an array, so s->cpu_enabled ? "En" : "Dis" returns
"En" always. We should use s->cpu_enabled[cpu] here.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
---
 hw/arm_gic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Evgeny Voevodin - Oct. 4, 2012, 11:50 a.m.
On 10/02/2012 07:50 AM, Evgeny Voevodin wrote:
> s->cpu_enabled is an array, so s->cpu_enabled ? "En" : "Dis" returns
> "En" always. We should use s->cpu_enabled[cpu] here.
>
> Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
> ---
>   hw/arm_gic.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/arm_gic.c b/hw/arm_gic.c
> index 55871fa..4024dae 100644
> --- a/hw/arm_gic.c
> +++ b/hw/arm_gic.c
> @@ -566,7 +566,7 @@ static void gic_cpu_write(gic_state *s, int cpu, int offset, uint32_t value)
>       switch (offset) {
>       case 0x00: /* Control */
>           s->cpu_enabled[cpu] = (value & 1);
> -        DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled ? "En" : "Dis");
> +        DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled[cpu] ? "En" : "Dis");
>           break;
>       case 0x04: /* Priority mask */
>           s->priority_mask[cpu] = (value & 0xff);

Did anybody pick this up?
Peter Maydell - Oct. 4, 2012, 11:59 a.m.
On 4 October 2012 12:50, Evgeny Voevodin <e.voevodin@samsung.com> wrote:
> On 10/02/2012 07:50 AM, Evgeny Voevodin wrote:
>>
>> s->cpu_enabled is an array, so s->cpu_enabled ? "En" : "Dis" returns
>> "En" always. We should use s->cpu_enabled[cpu] here.
>
> Did anybody pick this up?

Yeah, I've put it in arm-devs.next.

-- PMM

Patch

diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index 55871fa..4024dae 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -566,7 +566,7 @@  static void gic_cpu_write(gic_state *s, int cpu, int offset, uint32_t value)
     switch (offset) {
     case 0x00: /* Control */
         s->cpu_enabled[cpu] = (value & 1);
-        DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled ? "En" : "Dis");
+        DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled[cpu] ? "En" : "Dis");
         break;
     case 0x04: /* Priority mask */
         s->priority_mask[cpu] = (value & 0xff);