Patchwork [v2,2/3] debugcon: make debug message more readable

login
register
mail settings
Submitter liguang
Date April 15, 2013, 2:14 a.m.
Message ID <1365992066-24348-2-git-send-email-lig.fnst@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/236486/
State New
Headers show

Comments

liguang - April 15, 2013, 2:14 a.m.
before change:
Bdebugcon: write addr=0x0000 val=0x6f
odebugcon: write addr=0x0000 val=0x6f
odebugcon: write addr=0x0000 val=0x74
tdebugcon: write addr=0x0000 val=0x69
idebugcon: write addr=0x0000 val=0x6e
ndebugcon: write addr=0x0000 val=0x67
gdebugcon: write addr=0x0000 val=0x20
 debugcon: write addr=0x0000 val=0x66

after change:
B [debugcon: write addr=0x0000 val=0x6f]
o [debugcon: write addr=0x0000 val=0x6f]
o [debugcon: write addr=0x0000 val=0x74]
t [debugcon: write addr=0x0000 val=0x69]
i [debugcon: write addr=0x0000 val=0x6e]
n [debugcon: write addr=0x0000 val=0x67]
g [debugcon: write addr=0x0000 val=0x20]
  [debugcon: write addr=0x0000 val=0x66]

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
 hw/char/debugcon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jesse Larrew - April 16, 2013, 2:44 a.m.
On 04/14/2013 09:14 PM, liguang wrote:
>  #ifdef DEBUG_DEBUGCON
> -    printf("debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02x\n", addr, val);
> +    printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02]\n", addr, val);

I like the reformatting, but it looks like you accidentally clobbered the
'x' when you added the ']'. This is the cause of the compiler warnings in
patch #3.

Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
jlarrew@linux.vnet.ibm.com
liguang - April 16, 2013, 3:39 a.m.
在 2013-04-15一的 21:44 -0500,Jesse Larrew写道:
> On 04/14/2013 09:14 PM, liguang wrote:
> >  #ifdef DEBUG_DEBUGCON
> > -    printf("debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02x\n", addr, val);
> > +    printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02]\n", addr, val);
> 
> I like the reformatting, but it looks like you accidentally clobbered the
> 'x' when you added the ']'. This is the cause of the compiler warnings in
> patch #3.

Oh, really should not clobber 'x'
Thanks!
but the main warnings were not triggered by this.


> 
> Jesse Larrew
> Software Engineer, KVM Team
> IBM Linux Technology Center
> Phone: (512) 973-2052 (T/L: 363-2052)
> jlarrew@linux.vnet.ibm.com
>

Patch

diff --git a/hw/char/debugcon.c b/hw/char/debugcon.c
index 44c93e1..b6f2b06 100644
--- a/hw/char/debugcon.c
+++ b/hw/char/debugcon.c
@@ -55,7 +55,7 @@  static void debugcon_ioport_write(void *opaque, hwaddr addr, uint64_t val,
     unsigned char ch = val;
 
 #ifdef DEBUG_DEBUGCON
-    printf("debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02x\n", addr, val);
+    printf(" [debugcon: write addr=0x%04" HWADDR_PRIx " val=0x%02]\n", addr, val);
 #endif
 
     qemu_chr_fe_write(s->chr, &ch, 1);