Clean up const usage to avoid excessive casting
Don't use const on pointers that hold heap allocated data, because that means functions that free them must cast away the const. Do use const on pointer parameters or fields that needn't be modified. Remove pointer casts that are no longer needed after fixing the constness. Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1668 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
committed by
Spencer Oliver
parent
c044c60121
commit
517ba0690d
@@ -1048,9 +1048,9 @@ static int mips_m4k_write_memory(struct target *target, uint32_t address,
|
||||
/* if noDMA off, use DMAACC mode for memory write */
|
||||
int retval;
|
||||
if (ejtag_info->impcode & EJTAG_IMP_NODMA)
|
||||
retval = mips32_pracc_write_mem(ejtag_info, address, size, count, (void *)buffer);
|
||||
retval = mips32_pracc_write_mem(ejtag_info, address, size, count, buffer);
|
||||
else
|
||||
retval = mips32_dmaacc_write_mem(ejtag_info, address, size, count, (void *)buffer);
|
||||
retval = mips32_dmaacc_write_mem(ejtag_info, address, size, count, buffer);
|
||||
|
||||
if (t != NULL)
|
||||
free(t);
|
||||
|
||||
Reference in New Issue
Block a user