All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG
@ 2020-09-09  8:36 Dov Murik
  2020-09-09  8:36 ` [PATCH 1/2] hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw Dov Murik
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Dov Murik @ 2020-09-09  8:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Dov Murik, Michael S. Tsirkin

Fix several compiler errors when compiling withe -DHPET_DEBUG.

Steps to reproduce the issue:

    mkdir build
    cd build
    ../configure --target-list=x86_64-softmmu --extra-cflags=-DHPET_DEBUG
    make

Dov Murik (2):
  hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
  hw/timer/hpet: Fix debug format strings

 hw/timer/hpet.c | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
  2020-09-09  8:36 [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Dov Murik
@ 2020-09-09  8:36 ` Dov Murik
  2020-09-09  8:36 ` [PATCH 2/2] hw/timer/hpet: Fix debug format strings Dov Murik
  2020-09-09 17:24 ` [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Philippe Mathieu-Daudé
  2 siblings, 0 replies; 7+ messages in thread
From: Dov Murik @ 2020-09-09  8:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Dov Murik, Michael S. Tsirkin

Fix compiler error about defined but not used functions when compiling
with -DHPET_DEBUG by deleting the unused debug functions hpet_ram_readb
and hpet_ram_readw.

Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
---
 hw/timer/hpet.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index 380acfa7c8..b683f64f1d 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -416,20 +416,6 @@ static void hpet_del_timer(HPETTimer *t)
     update_irq(t, 0);
 }
 
-#ifdef HPET_DEBUG
-static uint32_t hpet_ram_readb(void *opaque, hwaddr addr)
-{
-    printf("qemu: hpet_read b at %" PRIx64 "\n", addr);
-    return 0;
-}
-
-static uint32_t hpet_ram_readw(void *opaque, hwaddr addr)
-{
-    printf("qemu: hpet_read w at %" PRIx64 "\n", addr);
-    return 0;
-}
-#endif
-
 static uint64_t hpet_ram_read(void *opaque, hwaddr addr,
                               unsigned size)
 {
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] hw/timer/hpet: Fix debug format strings
  2020-09-09  8:36 [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Dov Murik
  2020-09-09  8:36 ` [PATCH 1/2] hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw Dov Murik
@ 2020-09-09  8:36 ` Dov Murik
  2020-09-09 17:24 ` [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Philippe Mathieu-Daudé
  2 siblings, 0 replies; 7+ messages in thread
From: Dov Murik @ 2020-09-09  8:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Dov Murik, Michael S. Tsirkin

Fix compiler errors when compiling with -DHPET_DEBUG due to mismatch
between format string token "%x" and the argument type uint64_t.

Also "%#x" is replaced by "0x%" PRIx64 according to the coding style.

Signed-off-by: Dov Murik <dovmurik@linux.vnet.ibm.com>
---
 hw/timer/hpet.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/hw/timer/hpet.c b/hw/timer/hpet.c
index b683f64f1d..73d2168c32 100644
--- a/hw/timer/hpet.c
+++ b/hw/timer/hpet.c
@@ -495,7 +495,8 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
     HPETState *s = opaque;
     uint64_t old_val, new_val, val, index;
 
-    DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value);
+    DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = 0x%" PRIx64 "\n",
+            addr, value);
     index = addr;
     old_val = hpet_ram_read(opaque, addr, 4);
     new_val = value;
@@ -505,7 +506,7 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
         uint8_t timer_id = (addr - 0x100) / 0x20;
         HPETTimer *timer = &s->timer[timer_id];
 
-        DPRINTF("qemu: hpet_ram_writel timer_id = %#x\n", timer_id);
+        DPRINTF("qemu: hpet_ram_writel timer_id = 0x%x\n", timer_id);
         if (timer_id > s->num_timers) {
             DPRINTF("qemu: timer id out of range\n");
             return;
@@ -637,8 +638,8 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
             }
             s->hpet_counter =
                 (s->hpet_counter & 0xffffffff00000000ULL) | value;
-            DPRINTF("qemu: HPET counter written. ctr = %#x -> %" PRIx64 "\n",
-                    value, s->hpet_counter);
+            DPRINTF("qemu: HPET counter written. ctr = 0x%" PRIx64 " -> "
+                    "%" PRIx64 "\n", value, s->hpet_counter);
             break;
         case HPET_COUNTER + 4:
             if (hpet_enabled(s)) {
@@ -646,8 +647,8 @@ static void hpet_ram_write(void *opaque, hwaddr addr,
             }
             s->hpet_counter =
                 (s->hpet_counter & 0xffffffffULL) | (((uint64_t)value) << 32);
-            DPRINTF("qemu: HPET counter + 4 written. ctr = %#x -> %" PRIx64 "\n",
-                    value, s->hpet_counter);
+            DPRINTF("qemu: HPET counter + 4 written. ctr = 0x%" PRIx64 " -> "
+                    "%" PRIx64 "\n", value, s->hpet_counter);
             break;
         default:
             DPRINTF("qemu: invalid hpet_ram_writel\n");
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG
  2020-09-09  8:36 [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Dov Murik
  2020-09-09  8:36 ` [PATCH 1/2] hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw Dov Murik
  2020-09-09  8:36 ` [PATCH 2/2] hw/timer/hpet: Fix debug format strings Dov Murik
@ 2020-09-09 17:24 ` Philippe Mathieu-Daudé
  2020-09-10 12:53   ` Dov Murik
  2 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-09 17:24 UTC (permalink / raw)
  To: Dov Murik, qemu-devel; +Cc: Paolo Bonzini, Michael S. Tsirkin

On 9/9/20 10:36 AM, Dov Murik wrote:
> Fix several compiler errors when compiling withe -DHPET_DEBUG.
> 
> Steps to reproduce the issue:
> 
>     mkdir build
>     cd build
>     ../configure --target-list=x86_64-softmmu --extra-cflags=-DHPET_DEBUG
>     make
> 
> Dov Murik (2):
>   hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
>   hw/timer/hpet: Fix debug format strings
> 
>  hw/timer/hpet.c | 27 +++++++--------------------
>  1 file changed, 7 insertions(+), 20 deletions(-)
> 

I sent almost the same patches last week :)
https://www.mail-archive.com/qemu-devel@nongnu.org/msg736836.html

You seem to fix a 4th format, can you rebase on top? (As these
patches have already been queued).

Glad to see you are interested in debugging the HPET too.

Regards,

Phil.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG
  2020-09-09 17:24 ` [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Philippe Mathieu-Daudé
@ 2020-09-10 12:53   ` Dov Murik
  2020-09-13 11:42     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Dov Murik @ 2020-09-10 12:53 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Paolo Bonzini, Michael S. Tsirkin

On 09/09/2020 20:24, Philippe Mathieu-Daudé wrote:
> On 9/9/20 10:36 AM, Dov Murik wrote:
>> Fix several compiler errors when compiling withe -DHPET_DEBUG.
>>
>> Steps to reproduce the issue:
>>
>>      mkdir build
>>      cd build
>>      ../configure --target-list=x86_64-softmmu --extra-cflags=-DHPET_DEBUG
>>      make
>>
>> Dov Murik (2):
>>    hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
>>    hw/timer/hpet: Fix debug format strings
>>
>>   hw/timer/hpet.c | 27 +++++++--------------------
>>   1 file changed, 7 insertions(+), 20 deletions(-)
>>
> 
> I sent almost the same patches last week :)
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg736836.html

Oops, missed that. You're right.

> You seem to fix a 4th format, can you rebase on top? (As these
> patches have already been queued).

Actually there's a small issue in one of your suggested fixes: you added 
"0x" but kept the "%#".  I think it should be without the "#" (also 
according to the coding style document).

I suggest you fix this small issue, and also add any changes you wish 
from this patchset; then we can throw my patchset to the bin.

-Dov


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG
  2020-09-10 12:53   ` Dov Murik
@ 2020-09-13 11:42     ` Philippe Mathieu-Daudé
  2020-09-16  9:15       ` Laurent Vivier
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-13 11:42 UTC (permalink / raw)
  To: Dov Murik, qemu-devel; +Cc: QEMU Trivial, Paolo Bonzini, Michael S. Tsirkin

Cc'ing qemu-trivial@

On 9/10/20 2:53 PM, Dov Murik wrote:
> On 09/09/2020 20:24, Philippe Mathieu-Daudé wrote:
>> On 9/9/20 10:36 AM, Dov Murik wrote:
>>> Fix several compiler errors when compiling withe -DHPET_DEBUG.
>>>
>>> Steps to reproduce the issue:
>>>
>>>      mkdir build
>>>      cd build
>>>      ../configure --target-list=x86_64-softmmu
>>> --extra-cflags=-DHPET_DEBUG
>>>      make
>>>
>>> Dov Murik (2):
>>>    hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
>>>    hw/timer/hpet: Fix debug format strings
>>>
>>>   hw/timer/hpet.c | 27 +++++++--------------------
>>>   1 file changed, 7 insertions(+), 20 deletions(-)
>>>
>>
>> I sent almost the same patches last week :)
>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg736836.html
> 
> Oops, missed that. You're right.
> 
>> You seem to fix a 4th format, can you rebase on top? (As these
>> patches have already been queued).
> 
> Actually there's a small issue in one of your suggested fixes: you added
> "0x" but kept the "%#".  I think it should be without the "#" (also
> according to the coding style document).
> 
> I suggest you fix this small issue, and also add any changes you wish
> from this patchset; then we can throw my patchset to the bin.

Let's use your patchset instead.

Series:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> -Dov
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG
  2020-09-13 11:42     ` Philippe Mathieu-Daudé
@ 2020-09-16  9:15       ` Laurent Vivier
  0 siblings, 0 replies; 7+ messages in thread
From: Laurent Vivier @ 2020-09-16  9:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Dov Murik, qemu-devel
  Cc: QEMU Trivial, Paolo Bonzini, Michael S. Tsirkin

Le 13/09/2020 à 13:42, Philippe Mathieu-Daudé a écrit :
> Cc'ing qemu-trivial@
> 
> On 9/10/20 2:53 PM, Dov Murik wrote:
>> On 09/09/2020 20:24, Philippe Mathieu-Daudé wrote:
>>> On 9/9/20 10:36 AM, Dov Murik wrote:
>>>> Fix several compiler errors when compiling withe -DHPET_DEBUG.
>>>>
>>>> Steps to reproduce the issue:
>>>>
>>>>      mkdir build
>>>>      cd build
>>>>      ../configure --target-list=x86_64-softmmu
>>>> --extra-cflags=-DHPET_DEBUG
>>>>      make
>>>>
>>>> Dov Murik (2):
>>>>    hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw
>>>>    hw/timer/hpet: Fix debug format strings
>>>>
>>>>   hw/timer/hpet.c | 27 +++++++--------------------
>>>>   1 file changed, 7 insertions(+), 20 deletions(-)
>>>>
>>>
>>> I sent almost the same patches last week :)
>>> https://www.mail-archive.com/qemu-devel@nongnu.org/msg736836.html
>>
>> Oops, missed that. You're right.
>>
>>> You seem to fix a 4th format, can you rebase on top? (As these
>>> patches have already been queued).
>>
>> Actually there's a small issue in one of your suggested fixes: you added
>> "0x" but kept the "%#".  I think it should be without the "#" (also
>> according to the coding style document).
>>
>> I suggest you fix this small issue, and also add any changes you wish
>> from this patchset; then we can throw my patchset to the bin.
> 
> Let's use your patchset instead.
> 
> Series:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 

Series applied to my trivial-patches branch.

Thanks,
Laurent





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-16  9:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09  8:36 [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Dov Murik
2020-09-09  8:36 ` [PATCH 1/2] hw/timer/hpet: Remove unused functions hpet_ram_readb, hpet_ram_readw Dov Murik
2020-09-09  8:36 ` [PATCH 2/2] hw/timer/hpet: Fix debug format strings Dov Murik
2020-09-09 17:24 ` [PATCH 0/2] hw/timer/hpet: Fix compiler errors with -DHPET_DEBUG Philippe Mathieu-Daudé
2020-09-10 12:53   ` Dov Murik
2020-09-13 11:42     ` Philippe Mathieu-Daudé
2020-09-16  9:15       ` Laurent Vivier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.