X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fmflash.c;h=5c8ca8c16b46cc6912301c814cc3faa38a2e8999;hp=43d8ddd326b3c68fdc0264da570c59114fe2e093;hb=08a890e4aae307d874bd617f4dc742a56f2064a2;hpb=c79cca04bed78839a18e73f3996805eb8001a812 diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 43d8ddd326..5c8ca8c16b 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -22,8 +22,8 @@ #endif #include "mflash.h" -#include "target.h" -#include "time_support.h" +#include +#include #include #include @@ -342,7 +342,8 @@ static int mg_dsk_drv_info(void) if ((ret = mg_dsk_io_cmd(0, 1, mg_io_cmd_identify)) != ERROR_OK) return ret; - if ((ret = mg_dsk_wait(mg_io_wait_drq, MG_OEM_DISK_WAIT_TIME_NORMAL)) != ERROR_OK) + ret = mg_dsk_wait(mg_io_wait_drq, MG_OEM_DISK_WAIT_TIME_NORMAL); + if (ret != ERROR_OK) return ret; LOG_INFO("mflash: read drive info"); @@ -350,7 +351,8 @@ static int mg_dsk_drv_info(void) if (! mflash_bank->drv_info) mflash_bank->drv_info = malloc(sizeof(struct mg_drv_info)); - target_read_memory(target, mg_buff, 2, sizeof(mg_io_type_drv_info) >> 1, + ret = target_read_memory(target, mg_buff, 2, + sizeof(mg_io_type_drv_info) >> 1, (uint8_t *)&mflash_bank->drv_info->drv_id); if (ret != ERROR_OK) return ret; @@ -1343,7 +1345,8 @@ COMMAND_HANDLER(mg_bank_cmd) char *str; mflash_bank->rst_pin.num = strtoul(CMD_ARGV[2], &str, 0); if (*str) - mflash_bank->rst_pin.port[0] = (uint16_t)tolower(str[0]); + mflash_bank->rst_pin.port[0] = (uint16_t) + tolower((unsigned)str[0]); mflash_bank->target = target;