From 7fd9ba22ba2faefc2b6cadeb7c26c23981458339 Mon Sep 17 00:00:00 2001 From: oharboe Date: Mon, 6 Oct 2008 12:09:27 +0000 Subject: Centralize error handling for buggy register handling git-svn-id: svn://svn.berlios.de/openocd/trunk@1019 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/target.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/target/target.c') diff --git a/src/target/target.c b/src/target/target.c index 3426b23e..f530eb31 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1212,7 +1212,7 @@ int target_checksum_memory(struct target_s *target, u32 address, u32 size, u32* } if ((retval = target->type->checksum_memory(target, address, - size, &checksum)) == ERROR_TARGET_RESOURCE_NOT_AVAILABLE) + size, &checksum)) != ERROR_OK) { buffer = malloc(size); if (buffer == NULL) @@ -1625,11 +1625,6 @@ int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args if (reg->valid == 0) { reg_arch_type_t *arch_type = register_get_arch_type(reg->arch_type); - if (arch_type == NULL) - { - LOG_ERROR("BUG: encountered unregistered arch type"); - return ERROR_OK; - } arch_type->get(reg); } value = buf_to_str(reg->value, reg->size, 16); @@ -1645,12 +1640,6 @@ int handle_reg_command(struct command_context_s *cmd_ctx, char *cmd, char **args str_to_buf(args[1], strlen(args[1]), buf, reg->size, 0); reg_arch_type_t *arch_type = register_get_arch_type(reg->arch_type); - if (arch_type == NULL) - { - LOG_ERROR("BUG: encountered unregistered arch type"); - return ERROR_OK; - } - arch_type->set(reg, buf); value = buf_to_str(reg->value, reg->size, 16); -- cgit v1.2.3