diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2013-09-30 23:16:20 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-31 20:42:34 +0000 |
commit | 517ba0690dcc9e859a05df2113ce32401a5ab254 (patch) | |
tree | 7f437e78a54eb7cb6af06ed589c8ceef0c5277bf /src/jtag/drivers/ulink.c | |
parent | c044c601213ee800cffb21e1f53a89285b3346c9 (diff) | |
download | riscv-openocd-517ba0690dcc9e859a05df2113ce32401a5ab254.zip riscv-openocd-517ba0690dcc9e859a05df2113ce32401a5ab254.tar.gz riscv-openocd-517ba0690dcc9e859a05df2113ce32401a5ab254.tar.bz2 |
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>
Diffstat (limited to 'src/jtag/drivers/ulink.c')
-rw-r--r-- | src/jtag/drivers/ulink.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/jtag/drivers/ulink.c b/src/jtag/drivers/ulink.c index 9a7d8c8..d93150d 100644 --- a/src/jtag/drivers/ulink.c +++ b/src/jtag/drivers/ulink.c @@ -169,9 +169,9 @@ int ulink_usb_close(struct ulink **device); /* ULINK MCU (Cypress EZ-USB) specific functions */ int ulink_cpu_reset(struct ulink *device, unsigned char reset_bit); -int ulink_load_firmware_and_renumerate(struct ulink **device, char *filename, +int ulink_load_firmware_and_renumerate(struct ulink **device, const char *filename, uint32_t delay); -int ulink_load_firmware(struct ulink *device, char *filename); +int ulink_load_firmware(struct ulink *device, const char *filename); int ulink_write_firmware_section(struct ulink *device, struct image *firmware_image, int section_index); @@ -362,7 +362,7 @@ int ulink_cpu_reset(struct ulink *device, unsigned char reset_bit) * @return on failure: ERROR_FAIL */ int ulink_load_firmware_and_renumerate(struct ulink **device, - char *filename, uint32_t delay) + const char *filename, uint32_t delay) { int ret; @@ -397,7 +397,7 @@ int ulink_load_firmware_and_renumerate(struct ulink **device, * @return on success: ERROR_OK * @return on failure: ERROR_FAIL */ -int ulink_load_firmware(struct ulink *device, char *filename) +int ulink_load_firmware(struct ulink *device, const char *filename) { struct image ulink_firmware_image; int ret, i; @@ -2284,7 +2284,7 @@ COMMAND_HANDLER(ulink_download_firmware_handler) LOG_INFO("Downloading ULINK firmware image %s", CMD_ARGV[0]); /* Download firmware image in CMD_ARGV[0] */ - ret = ulink_load_firmware_and_renumerate(&ulink_handle, (char *)CMD_ARGV[0], + ret = ulink_load_firmware_and_renumerate(&ulink_handle, CMD_ARGV[0], ULINK_RENUMERATION_DELAY); return ret; |