From d86cf998e887d6e1bac2754b3087710926c74a19 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Tue, 23 Jun 2009 13:54:05 +0000 Subject: Sansa AMS debug: small fixes - Indentation fix - Put braces around _DEBUG_PRINTF macro - read_cp15() is only 1 instruction so inline it, and it doesn't access memory git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21477 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/debug-as3525.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 405b7109b1..39f590302d 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c @@ -29,8 +29,9 @@ #include "cpu.h" #include "pl180.h" -#define _DEBUG_PRINTF(a,varargs...) \ - snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf) +#define _DEBUG_PRINTF(a,varargs...) do { \ + snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf); \ + } while(0) #define ON "Enabled" #define OFF "Disabled" @@ -70,15 +71,12 @@ unsigned short button_dbop_data(void); #endif -static unsigned read_cp15 (void) +static inline unsigned read_cp15 (void) { - unsigned value; - + unsigned cp15_value; asm volatile ( - "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n":"=r" - (value)::"memory" - ); - return (value); + "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n" : "=r"(cp15_value)); + return (cp15_value); } int calc_freq(int clk) @@ -222,7 +220,7 @@ int calc_freq(int clk) bool __dbg_hw_info(void) { -char buf[50]; + char buf[50]; int line; lcd_clear_display(); -- cgit v1.2.3