diff options
author | Matthias Blaicher <matthias@blaicher.com> | 2012-10-27 17:21:24 +0200 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2012-10-28 01:25:39 +0000 |
commit | 3a6ac237163b9a2c480c020064aabf4c2b199543 (patch) | |
tree | 0722b510f6c5828f9904f683ef566bec4c00c623 /src/rtos/eCos.c | |
parent | a4dc39beb4c5678476d40e4e13f0a79d45145460 (diff) |
rtos: Use ARRAY_SIZE instead of coding it by hand
Use ARRAY_SIZE in helper/types.h to determine the size of the
symbol list.
Change-Id: Icc9838323510f8602efa5d0162a4daed33f863b9
Signed-off-by: Matthias Blaicher <matthias@blaicher.com>
Reviewed-on: http://openocd.zylin.com/935
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'src/rtos/eCos.c')
-rw-r--r-- | src/rtos/eCos.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/rtos/eCos.c b/src/rtos/eCos.c index 5c18916a..7964712f 100644 --- a/src/rtos/eCos.c +++ b/src/rtos/eCos.c @@ -26,6 +26,7 @@ #include "target/target_type.h" #include "rtos.h" #include "helper/log.h" +#include "helper/types.h" #include "rtos_ecos_stackings.h" static int eCos_detect_rtos(struct target *target); @@ -87,8 +88,6 @@ static char *eCos_symbol_list[] = { NULL }; -#define ECOS_NUM_SYMBOLS (sizeof(eCos_symbol_list)/sizeof(char *)) - const struct rtos_type eCos_rtos = { .name = "eCos", @@ -379,9 +378,9 @@ static int eCos_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[]) { unsigned int i; *symbol_list = (symbol_table_elem_t *) malloc( - sizeof(symbol_table_elem_t) * ECOS_NUM_SYMBOLS); + sizeof(symbol_table_elem_t) * ARRAY_SIZE(eCos_symbol_list)); - for (i = 0; i < ECOS_NUM_SYMBOLS; i++) + for (i = 0; i < ARRAY_SIZE(eCos_symbol_list); i++) (*symbol_list)[i].symbol_name = eCos_symbol_list[i]; return 0; |