forked from auracaster/openocd
flash/nor: Use proper data types in driver API
Use 'unsigned int' and 'bool' instead of 'int' where appropriate. While at it, fix some coding style issues. No new Clang analyzer warnings. Change-Id: I700802c9ee81c3c7ae73108f0f8f06b15a4345f8 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/4929 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
@@ -85,13 +85,12 @@ FLASH_BANK_COMMAND_HANDLER(aducm360_flash_bank_command)
|
||||
/* ----------------------------------------------------------------------- */
|
||||
static int aducm360_build_sector_list(struct flash_bank *bank)
|
||||
{
|
||||
int i = 0;
|
||||
uint32_t offset = 0;
|
||||
|
||||
/* sector size is 512 */
|
||||
bank->num_sectors = bank->size / FLASH_SECTOR_SIZE;
|
||||
bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
|
||||
for (i = 0; i < bank->num_sectors; ++i) {
|
||||
for (unsigned i = 0; i < bank->num_sectors; ++i) {
|
||||
bank->sectors[i].offset = offset;
|
||||
bank->sectors[i].size = FLASH_SECTOR_SIZE;
|
||||
offset += bank->sectors[i].size;
|
||||
@@ -164,7 +163,8 @@ static int aducm360_page_erase(struct target *target, uint32_t padd)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
static int aducm360_erase(struct flash_bank *bank, int first, int last)
|
||||
static int aducm360_erase(struct flash_bank *bank, unsigned int first,
|
||||
unsigned int last)
|
||||
{
|
||||
int res = ERROR_OK;
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user