From 71cde5e359f273585880ea8986709b950ba85b08 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 19 Nov 2009 19:02:10 -0800 Subject: target: create/use register_cache_invalidate() Create a generic register_cache_invalidate(), and use it to replace three all-but-identical core-specific routines: - armv4_5_invalidate_core_regs() - armv7m_invalidate_core_regs - mips32_invalidate_core_regs() too. Make cache->num_regs be unsigned, avoiding various errors. Net code shrink and simplification. Signed-off-by: David Brownell --- src/target/target.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/target/target.c') diff --git a/src/target/target.c b/src/target/target.c index f203913c..70fd8f2b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1860,7 +1860,7 @@ COMMAND_HANDLER(handle_reg_command) { struct target *target; struct reg *reg = NULL; - int count = 0; + unsigned count = 0; char *value; LOG_DEBUG("-"); @@ -1875,7 +1875,7 @@ COMMAND_HANDLER(handle_reg_command) count = 0; while (cache) { - int i; + unsigned i; command_print(CMD_CTX, "===== %s", cache->name); @@ -1917,10 +1917,10 @@ COMMAND_HANDLER(handle_reg_command) count = 0; while (cache) { - int i; + unsigned i; for (i = 0; i < cache->num_regs; i++) { - if (count++ == (int)num) + if (count++ == num) { reg = &cache->reg_list[i]; break; -- cgit v1.2.3