Skip to contentSkip to conversation

PPC: dbdma: macio: Fix format specifiers (build regression)

PATCH In review Stefan Weil 4 participants 8 messages Jul 12, 2013 – Jul 23, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC: dbdma: macio: Fix format specifiers (build regression)

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

CC hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format] qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

---

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

 hw/ide/macio.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
hw/ide/macio.c +5 -4
index 38ad924..ef4ba2b 100644
@@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
         int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
         int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         bdrv_read(s->bs, sector_num + nsector, io->remainder, 1);
@@ -212,14 +212,15 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         s->nsector -= n;
     }
 
-    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d sector_num: %ld\n",
+    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d "
+                  "sector_num: %" PRId64 "\n",
                   io->remainder_len, io->len, s->nsector, sector_num);
     if (io->remainder_len && io->len) {
         /* guest wants the rest of its previous transfer */
         int remainder_len = MIN(io->remainder_len, io->len);
         uint8_t *p = &io->remainder[0x200 - remainder_len];
 
-        MACIO_DPRINTF("copying remainder %d bytes at %#lx\n",
+        MACIO_DPRINTF("copying remainder %d bytes at %#" HWADDR_PRIx "\n",
                       remainder_len, io->addr);
 
         switch (s->dma_cmd) {
@@ -261,7 +262,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
     if (unaligned) {
         int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         switch (s->dma_cmd) {
Signature · 1 line
1.7.10.4
#1 lore raw

Am 12.07.2013 18:48, schrieb Stefan Weil:

Quoted 62 lines

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

CC hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format] qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

---

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

 hw/ide/macio.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
hw/ide/macio.c +4 -3
index 38ad924..ef4ba2b 100644
@@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
         int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
         int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         bdrv_read(s->bs, sector_num + nsector, io->remainder, 1);
@@ -212,14 +212,15 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         s->nsector -= n;
     }
 
-    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d sector_num: %ld\n",
+    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d "
+                  "sector_num: %" PRId64 "\n",
                   io->remainder_len, io->len, s->nsector, sector_num);
     if (io->remainder_len && io->len) {
         /* guest wants the rest of its previous transfer */
         int remainder_len = MIN(io->remainder_len, io->len);
         uint8_t *p = &io->remainder[0x200 - remainder_len];
 
-        MACIO_DPRINTF("copying remainder %d bytes at %#lx\n",
+        MACIO_DPRINTF("copying remainder %d bytes at %#" HWADDR_PRIx "\n",
                       remainder_len, io->addr);
 
         switch (s->dma_cmd) {

hw/ide/macio.c static void pmac_ide_transfer_cb(void *opaque, int ret) · line 268

Quoted 8 lines
hw/ide/macio.c +1 -1
@@ -261,7 +262,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
     if (unaligned) {
         int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         switch (s->dma_cmd) {

Ping?

#2 lore raw

Am 16.07.2013 07:54, schrieb Stefan Weil:

Quoted 66 lines

Am 12.07.2013 18:48, schrieb Stefan Weil:

Quoted 65 lines

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

CC hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format] qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

---

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

 hw/ide/macio.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
hw/ide/macio.c +4 -3
index 38ad924..ef4ba2b 100644
@@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
         int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
         int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         bdrv_read(s->bs, sector_num + nsector, io->remainder, 1);
@@ -212,14 +212,15 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         s->nsector -= n;
     }
 
-    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d sector_num: %ld\n",
+    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d "
+                  "sector_num: %" PRId64 "\n",
                   io->remainder_len, io->len, s->nsector, sector_num);
     if (io->remainder_len && io->len) {
         /* guest wants the rest of its previous transfer */
         int remainder_len = MIN(io->remainder_len, io->len);
         uint8_t *p = &io->remainder[0x200 - remainder_len];
 
-        MACIO_DPRINTF("copying remainder %d bytes at %#lx\n",
+        MACIO_DPRINTF("copying remainder %d bytes at %#" HWADDR_PRIx "\n",
                       remainder_len, io->addr);
 
         switch (s->dma_cmd) {
@@ -261,7 +262,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
     if (unaligned) {
         int nsector = io->len >> 9;
 
Quoted 7 lines

hw/ide/macio.c static void pmac_ide_transfer_cb(void *opaque, int ret) · line 268

Quoted 5 lines
hw/ide/macio.c +1 -1
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                       unaligned, io->addr + io->len - unaligned);
 
         switch (s->dma_cmd) {

Ping?

Ping²?

#3 lore raw
Quoted 71 lines · Stefan Weil

Am 16.07.2013 07:54, schrieb Stefan Weil:

Quoted 70 lines

Am 12.07.2013 18:48, schrieb Stefan Weil:

Quoted 69 lines

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

CC hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format] qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

---

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

hw/ide/macio.c | 9 +++++----

1 file changed, 5 insertions(+), 4 deletions(-)
hw/ide/macio.c +5 -4
index 38ad924..ef4ba2b 100644
@@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
        int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
        int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                      unaligned, io->addr + io->len - unaligned);
 
        bdrv_read(s->bs, sector_num + nsector, io->remainder, 1);
@@ -212,14 +212,15 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
        s->nsector -= n;
    }
 
-    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d sector_num: %ld\n",
+    MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d "
+                  "sector_num: %" PRId64 "\n",
                  io->remainder_len, io->len, s->nsector, sector_num);
    if (io->remainder_len && io->len) {
        /* guest wants the rest of its previous transfer */
        int remainder_len = MIN(io->remainder_len, io->len);
        uint8_t *p = &io->remainder[0x200 - remainder_len];
 
-        MACIO_DPRINTF("copying remainder %d bytes at %#lx\n",
+        MACIO_DPRINTF("copying remainder %d bytes at %#" HWADDR_PRIx "\n",
                      remainder_len, io->addr);
 
        switch (s->dma_cmd) {
@@ -261,7 +262,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
    if (unaligned) {
        int nsector = io->len >> 9;
 
-        MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
+        MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
                      unaligned, io->addr + io->len - unaligned);
 
Quoted 6 lines
Quoted 3 lines

hw/ide/macio.c static void pmac_ide_transfer_cb(void *opaque, int ret) · line 268

Quoted 1 line
hw/ide/macio.c +0 -0
        switch (s->dma_cmd) {

Ping?

Ping²?

I assume this can go through the trivial tree? Or directly get applied by Anthony?

Alex

#4 lore raw

Am 19.07.2013 00:40, schrieb Alexander Graf:

Quoted 28 lines · Stefan Weil
Quoted 27 lines

Am 16.07.2013 07:54, schrieb Stefan Weil:

Quoted 25 lines

Am 12.07.2013 18:48, schrieb Stefan Weil:

Quoted 24 lines

Fix a number of warnings for 32 bit builds (tested on MingW and Linux):

CC hw/ide/macio.o
qemu/hw/ide/macio.c: In function 'pmac_ide_atapi_transfer_cb':
qemu/hw/ide/macio.c:134:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c: In function 'pmac_ide_transfer_cb':
qemu/hw/ide/macio.c:215:5: error: format '%ld' expects argument of type 'long int', but argument 5 has type 'int64_t' [-Werror=format] qemu/hw/ide/macio.c:222:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format] qemu/hw/ide/macio.c:264:9: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'hwaddr' [-Werror=format]
cc1: all warnings being treated as errors
make: *** [hw/ide/macio.o] Error 1

---

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

[...]

Quoted 2 lines

the trivial tree? Or directly get applied by Anthony? Alex

I still think that build regressions should be fixed by a direct maintainer commit instead of waiting for a pull request, but obviously this does not happen here (why?).

So hopefully the fix will be committed via qemu-trivial at least. See http://patchwork.ozlabs.org/patch/258774/ for the full patch.

Stefan

#5 lore raw

Am 19.07.2013 20:59, schrieb Stefan Weil:

Quoted 11 lines

Am 19.07.2013 00:40, schrieb Alexander Graf:

Quoted 10 lines · Stefan Weil
Quoted 9 lines

Am 16.07.2013 07:54, schrieb Stefan Weil:

Quoted 8 lines

Am 12.07.2013 18:48, schrieb Stefan Weil:

Quoted 7 lines

Hi Anthony,

the patch fixes a build regression which was introduced today. Could you please apply it without waiting for the next pull requests?

Thanks,
Stefan

Quoted 8 lines

[...]

Quoted 2 lines

the trivial tree? Or directly get applied by Anthony? Alex

I still think that build regressions should be fixed by a direct maintainer commit instead of waiting for a pull request, but obviously this does not happen here (why?).

Anthony recently stated very clearly that in order for him to pick up a patch it needs to have a Reviewed-by. This one only got an Acked-by.

Quoted 1 line

So hopefully the fix will be committed via qemu-trivial at least.

It's not obvious from the diff context whether those specifiers are in fact correct, and there is an active maintainer, so in theory it wouldn't qualify for -trivial.

Alex, don't be lazy and just send a one-patch PULL like Cornelia did for her recent mingw breakage. :)

Andreas

Quoted 3 lines

See http://patchwork.ozlabs.org/patch/258774/ for the full patch.

Stefan

Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#6 lore raw

Am 20.07.2013 16:24, schrieb Andreas Färber:

Quoted 3 lines

Anthony recently stated very clearly that in order for him to pick up a patch it needs to have a Reviewed-by. This one only got an Acked-by.

No rule without exception. When I look at the list of patches which were picked up recently, I see lots of patches without a Reviewed-by.

I still think that build regressions should be fixed very fast and don't understand why it takes so long:

http://patchwork.ozlabs.org/patch/257203/ (2013-07-05)
http://patchwork.ozlabs.org/patch/258774/ (2013-07-12)

Do we need more people with commit rights?

#7 lore raw
Quoted 6 lines · Stefan Weil

Am 20.07.2013 16:24, schrieb Andreas Färber:

Quoted 3 lines

Anthony recently stated very clearly that in order for him to pick up a patch it needs to have a Reviewed-by. This one only got an Acked-by.

Quoted 6 lines

No rule without exception. When I look at the list of patches which were picked up recently, I see lots of patches without a Reviewed-by.

I still think that build regressions should be fixed very fast and don't understand why it takes so long:

I reviewed the patch and it appears to be correct. Applied to the trivial patches queue. Thanks,

/mjt