From 7374dbc98dd075953cf76cb465e88ebe9e356c3c Mon Sep 17 00:00:00 2001 From: Tomek CEDRO Date: Wed, 2 Nov 2011 02:48:02 +0100 Subject: transport/swd: unused variables and headers build fixes for linux ubuntu 11.04. Thanks to Przemyslaw Wegrzyn for pointing this out :-) --- src/transport/swd.h | 7 +++---- src/transport/swd_core.c | 10 ++++------ src/transport/transport.h | 4 ++++ 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/transport') diff --git a/src/transport/swd.h b/src/transport/swd.h index cf737e32..590f6a10 100644 --- a/src/transport/swd.h +++ b/src/transport/swd.h @@ -36,14 +36,13 @@ /** \file swd.h SWD Transport Header File for OpenOCD. */ -#ifndef OOCD_SWD_H -#define OOCD_SWD_H - - #ifdef HAVE_CONFIG_H #include "config.h" #endif +#ifndef OOCD_SWD_H +#define OOCD_SWD_H + #include #include #include diff --git a/src/transport/swd_core.c b/src/transport/swd_core.c index f5c9faef..f1d4168d 100644 --- a/src/transport/swd_core.c +++ b/src/transport/swd_core.c @@ -42,10 +42,6 @@ * and external open-source SWD framework. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include ///Unfortunalety OpenOCD use globals to pass information so we need to use it too. @@ -143,7 +139,8 @@ int oocd_swd_transport_init(struct command_context *ctx){ } LOG_INFO("New SWD context initialized at 0x%p", (void *)dap->ctx); /* Now inherit the log level from OpenOCD settings. */ - if (swd_log_level_inherit((swd_ctx_t *)dap->ctx, debug_level)<0){ + retval=swd_log_level_inherit((swd_ctx_t *)dap->ctx, debug_level); + if (retval<0){ LOG_ERROR("Unable to set log level: %s", swd_error_string(retval)); return ERROR_FAIL; } @@ -178,7 +175,8 @@ int oocd_swd_transport_select(struct command_context *ctx){ jtag_interface->transport=(struct transport *)&oocd_transport_swd; - if (swd_register_commands(ctx)!=ERROR_OK){ + retval=swd_register_commands(ctx); + if (retval!=ERROR_OK){ LOG_ERROR("Unable to register SWD commands!"); return retval; } diff --git a/src/transport/transport.h b/src/transport/transport.h index b5e15ffd..5e080ac8 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -17,6 +17,10 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #ifndef OOCD_TRANSPORT_H #define OOCD_TRANSPORT_H -- cgit v1.2.3