diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2014-03-28 20:00:21 +0100 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2014-03-30 03:53:45 +0000 |
commit | e6907e6d7e4cfc108d03d05dc2686f989ba7213d (patch) | |
tree | df78111f6fc159db80b01f08d6c5e5cff0a841b1 /src/target/target.c | |
parent | 1171f07836840670e64d01f52c9147aa84866e50 (diff) |
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/target/target.c')
-rw-r--r-- | src/target/target.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/target/target.c b/src/target/target.c index 98201554..32ab1178 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -3190,7 +3190,7 @@ static COMMAND_HELPER(handle_verify_image_command_internal, int verify) if (diffs == 0) LOG_ERROR("checksum mismatch - attempting binary compare"); - data = (uint8_t *)malloc(buf_cnt); + data = malloc(buf_cnt); /* Can we use 32bit word accesses? */ int size = 1; @@ -5102,7 +5102,7 @@ static int target_create(Jim_GetOptInfo *goi) target->target_number = new_target_number(); /* allocate memory for each unique target type */ - target->type = (struct target_type *)calloc(1, sizeof(struct target_type)); + target->type = calloc(1, sizeof(struct target_type)); memcpy(target->type, target_types[x], sizeof(struct target_type)); @@ -5488,7 +5488,7 @@ COMMAND_HANDLER(handle_fast_load_image_command) image_size = 0x0; retval = ERROR_OK; fastload_num = image.num_sections; - fastload = (struct FastLoad *)malloc(sizeof(struct FastLoad)*image.num_sections); + fastload = malloc(sizeof(struct FastLoad)*image.num_sections); if (fastload == NULL) { command_print(CMD_CTX, "out of memory"); image_close(&image); |