target-mips: fix get_physical_address() #if 0 build error
PATCH 1/1 target-mips: fix get_physical_address() #if 0 build error
From: James Hogan <[email protected]>
In get_physical_address() is a qemu_log() call inside an #if 0 block. When enabled the following build error is hit:
target-mips/helper.c In function ‘get_physical_address’:target-mips/helper.c:220:13: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘hwaddr’ [-Werror=format]
Fix the *physical (hwaddr) formatting by using "%"HWADDR_PRIx instead of TARGET_FMT_lx.
--- target-mips/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
target-mips/helper.c +1 -1
@@ -193,7 +193,7 @@ static int get_physical_address (CPUMIPSState *env, hwaddr *physical, } }#if 0 -qemu_log (TARGET_FMT_lx" %d %d => " TARGET_FMT_lx" %d (%d)\n" , +qemu_log (TARGET_FMT_lx" %d %d => %" HWADDR_PRIx" %d (%d)\n" , address, rw, access_type, *physical, *prot, ret);#endif
Signature · 1 line
1.7.4
target-mips/helper.c static int get_physical_address (CPUMIPSState *env, hwaddr *physical, · line 198
Quoted 5 lines · Yongbok Kim
#if 0
target-mips/helper.c +1
-1-qemu_log (TARGET_FMT_lx" %d %d => " TARGET_FMT_lx" %d (%d)\n" , +qemu_log (TARGET_FMT_lx" %d %d => %" HWADDR_PRIx" %d (%d)\n" , address, rw, access_type, *physical, *prot, ret);#endif
While by itself correct, consider converting this to the trace infrastructure (with uint64_t instead of hwaddr).
If it's not worth a trace, it's probably not worth keeping at all.
r~
Quoted 11 lines · Richard Henderson
target-mips/helper.c static int get_physical_address (CPUMIPSState *env, hwaddr *physical, · line 198
Quoted 5 lines · Yongbok Kim
#if 0
target-mips/helper.c +1
-1-qemu_log (TARGET_FMT_lx" %d %d => " TARGET_FMT_lx" %d (%d)\n" , +qemu_log (TARGET_FMT_lx" %d %d => %" HWADDR_PRIx" %d (%d)\n" , address, rw, access_type, *physical, *prot, ret);#endif While by itself correct, consider converting this to the trace infrastructure (with
uint64_tinstead of hwaddr).If it's not worth a trace, it's probably not worth keeping at all.
True. I suspect it isn't worth a trace (I just happened to be modifying that function so tried it out to test my changes - and anybody doing that can easily add a temporary qemu_log/fprintf message themselves).
Cheers
James
Aurelien Jarno
AppliedQuoted 23 lines · Yongbok Kim
From: James Hogan <[email protected]>
In
get_physical_address()is aqemu_log()call inside an #if 0 block. When enabled the following build error is hit:
target-mips/helper.cIn function ‘get_physical_address’:target-mips/helper.c:220:13: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘hwaddr’ [-Werror=format]Fix the *physical (hwaddr) formatting by using "%"HWADDR_PRIx instead of
TARGET_FMT_lx.Signed-off-by James Hogan <[email protected]>Cc Aurelien Jarno <[email protected]>Signed-off-by Yongbok Kim <[email protected]>--- target-mips/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)target-mips/helper.c +0
-0
target-mips/helper.c static int get_physical_address (CPUMIPSState *env, hwaddr *physical, · line 198
Quoted 7 lines
target-mips/helper.c +1
-1@@ -193,7 +193,7 @@ static int get_physical_address (CPUMIPSState *env, hwaddr *physical, } }#if 0 -qemu_log (TARGET_FMT_lx" %d %d => " TARGET_FMT_lx" %d (%d)\n" , +qemu_log (TARGET_FMT_lx" %d %d => %" HWADDR_PRIx" %d (%d)\n" , address, rw, access_type, *physical, *prot, ret);#endif
Thanks, applied.
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net