aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.c
diff options
context:
space:
mode:
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>2014-03-28 20:00:21 +0100
committerPaul Fertser <fercerpav@gmail.com>2014-03-30 03:53:45 +0000
commite6907e6d7e4cfc108d03d05dc2686f989ba7213d (patch)
treedf78111f6fc159db80b01f08d6c5e5cff0a841b1 /src/rtos/rtos.c
parent1171f07836840670e64d01f52c9147aa84866e50 (diff)
downloadriscv-openocd-e6907e6d7e4cfc108d03d05dc2686f989ba7213d.zip
riscv-openocd-e6907e6d7e4cfc108d03d05dc2686f989ba7213d.tar.gz
riscv-openocd-e6907e6d7e4cfc108d03d05dc2686f989ba7213d.tar.bz2
Don't cast return value of [cm]alloc
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2069 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/rtos/rtos.c')
-rw-r--r--src/rtos/rtos.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 1cb6958..9ceeb26 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -289,7 +289,7 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
if (detail->extra_info_str != NULL)
str_size += strlen(detail->extra_info_str);
- char *tmp_str = (char *) malloc(str_size + 7);
+ char *tmp_str = malloc(str_size + 7);
char *tmp_str_ptr = tmp_str;
if (detail->display_str != NULL)
@@ -309,7 +309,7 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
assert(strlen(tmp_str) ==
(size_t) (tmp_str_ptr - tmp_str));
- char *hex_str = (char *) malloc(strlen(tmp_str) * 2 + 1);
+ char *hex_str = malloc(strlen(tmp_str) * 2 + 1);
int pkt_len = hexify(hex_str, tmp_str, 0, strlen(tmp_str) * 2 + 1);
gdb_put_packet(connection, hex_str, pkt_len);
@@ -334,7 +334,7 @@ int rtos_thread_packet(struct connection *connection, char const *packet, int pa
gdb_put_packet(connection, "l", 1);
} else {
/*thread id are 16 char +1 for ',' */
- char *out_str = (char *) malloc(17 * target->rtos->thread_count + 1);
+ char *out_str = malloc(17 * target->rtos->thread_count + 1);
char *tmp_str = out_str;
for (i = 0; i < target->rtos->thread_count; i++) {
tmp_str += sprintf(tmp_str, "%c%016" PRIx64, i == 0 ? 'm' : ',',
@@ -437,7 +437,7 @@ int rtos_generic_stack_read(struct target *target,
return -5;
}
/* Read the stack */
- uint8_t *stack_data = (uint8_t *) malloc(stacking->stack_registers_size);
+ uint8_t *stack_data = malloc(stacking->stack_registers_size);
uint32_t address = stack_ptr;
if (stacking->stack_growth_direction == 1)
@@ -456,7 +456,7 @@ int rtos_generic_stack_read(struct target *target,
#endif
for (i = 0; i < stacking->num_output_registers; i++)
list_size += stacking->register_offsets[i].width_bits/8;
- *hex_reg_list = (char *)malloc(list_size*2 + 1);
+ *hex_reg_list = malloc(list_size*2 + 1);
tmp_str_ptr = *hex_reg_list;
new_stack_ptr = stack_ptr - stacking->stack_growth_direction *
stacking->stack_registers_size;