Patchwork [v1,3/3] xilinx_ethlite: Debug mode compile fixes

login
register
mail settings
Submitter Peter Crosthwaite
Date Jan. 26, 2013, 8:36 p.m.
Message ID <dfbebe95-4e7d-4b78-a31a-b8ae3f2d9d3d@CH1EHSMHS032.ehs.local>
Download mbox | patch
Permalink /patch/215932/
State New
Headers show

Comments

Peter Crosthwaite - Jan. 26, 2013, 8:36 p.m.
Some printfs are throwing warnings when debug mode is enabled. Fixed.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---
 hw/xilinx_ethlite.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Edgar Iglesias - Jan. 27, 2013, 12:16 a.m.
On Sat, Jan 26, 2013 at 12:36:24PM -0800, Peter Crosthwaite wrote:
> Some printfs are throwing warnings when debug mode is enabled. Fixed.

I committed a slightly different version using TARGET_FMT_plx and %zd

> 
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
>  hw/xilinx_ethlite.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
> index 9463e92..5aeb73e 100644
> --- a/hw/xilinx_ethlite.c
> +++ b/hw/xilinx_ethlite.c
> @@ -89,7 +89,7 @@ eth_read(void *opaque, hwaddr addr, unsigned int size)
>          case R_RX_CTRL1:
>          case R_RX_CTRL0:
>              r = s->regs[addr];
> -            D(qemu_log("%s %x=%x\n", __func__, addr * 4, r));
> +            D(qemu_log("%s %x=%x\n", __func__, (unsigned)addr * 4, r));
>              break;
>  
>          default:
> @@ -115,7 +115,8 @@ eth_write(void *opaque, hwaddr addr,
>              if (addr == R_TX_CTRL1)
>                  base = 0x800 / 4;
>  
> -            D(qemu_log("%s addr=%x val=%x\n", __func__, addr * 4, value));
> +            D(qemu_log("%s addr=%x val=%x\n", __func__, (unsigned)addr * 4,
> +                       (unsigned)value));
>              if ((value & (CTRL_P | CTRL_S)) == CTRL_S) {
>                  qemu_send_packet(&s->nic->nc,
>                                   (void *) &s->regs[base],
> @@ -143,7 +144,8 @@ eth_write(void *opaque, hwaddr addr,
>          case R_TX_LEN0:
>          case R_TX_LEN1:
>          case R_TX_GIE0:
> -            D(qemu_log("%s addr=%x val=%x\n", __func__, addr * 4, value));
> +            D(qemu_log("%s addr=%x val=%x\n", __func__, (unsigned)addr * 4,
> +                       (unsigned)value));
>              s->regs[addr] = value;
>              break;
>  
> @@ -185,7 +187,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size)
>          return -1;
>      }
>  
> -    D(qemu_log("%s %d rxbase=%x\n", __func__, size, rxbase));
> +    D(qemu_log("%s %d rxbase=%x\n", __func__, (unsigned)size, rxbase));
>      memcpy(&s->regs[rxbase + R_RX_BUF0], buf, size);
>  
>      s->regs[rxbase + R_RX_CTRL0] |= CTRL_S;
> -- 
> 1.7.12.1.396.g16eed7c
> 
>

Patch

diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c
index 9463e92..5aeb73e 100644
--- a/hw/xilinx_ethlite.c
+++ b/hw/xilinx_ethlite.c
@@ -89,7 +89,7 @@  eth_read(void *opaque, hwaddr addr, unsigned int size)
         case R_RX_CTRL1:
         case R_RX_CTRL0:
             r = s->regs[addr];
-            D(qemu_log("%s %x=%x\n", __func__, addr * 4, r));
+            D(qemu_log("%s %x=%x\n", __func__, (unsigned)addr * 4, r));
             break;
 
         default:
@@ -115,7 +115,8 @@  eth_write(void *opaque, hwaddr addr,
             if (addr == R_TX_CTRL1)
                 base = 0x800 / 4;
 
-            D(qemu_log("%s addr=%x val=%x\n", __func__, addr * 4, value));
+            D(qemu_log("%s addr=%x val=%x\n", __func__, (unsigned)addr * 4,
+                       (unsigned)value));
             if ((value & (CTRL_P | CTRL_S)) == CTRL_S) {
                 qemu_send_packet(&s->nic->nc,
                                  (void *) &s->regs[base],
@@ -143,7 +144,8 @@  eth_write(void *opaque, hwaddr addr,
         case R_TX_LEN0:
         case R_TX_LEN1:
         case R_TX_GIE0:
-            D(qemu_log("%s addr=%x val=%x\n", __func__, addr * 4, value));
+            D(qemu_log("%s addr=%x val=%x\n", __func__, (unsigned)addr * 4,
+                       (unsigned)value));
             s->regs[addr] = value;
             break;
 
@@ -185,7 +187,7 @@  static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size)
         return -1;
     }
 
-    D(qemu_log("%s %d rxbase=%x\n", __func__, size, rxbase));
+    D(qemu_log("%s %d rxbase=%x\n", __func__, (unsigned)size, rxbase));
     memcpy(&s->regs[rxbase + R_RX_BUF0], buf, size);
 
     s->regs[rxbase + R_RX_CTRL0] |= CTRL_S;