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:
@@ -57,13 +57,12 @@ static int aduc702x_build_sector_list(struct flash_bank *bank)
|
||||
{
|
||||
/* aduc7026_struct flash_bank *aduc7026_info = bank->driver_priv; */
|
||||
|
||||
int i = 0;
|
||||
uint32_t offset = 0;
|
||||
|
||||
/* sector size is 512 */
|
||||
bank->num_sectors = bank->size / 512;
|
||||
bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
|
||||
for (i = 0; i < bank->num_sectors; ++i) {
|
||||
for (unsigned int i = 0; i < bank->num_sectors; ++i) {
|
||||
bank->sectors[i].offset = offset;
|
||||
bank->sectors[i].size = 512;
|
||||
offset += bank->sectors[i].size;
|
||||
@@ -74,7 +73,8 @@ static int aduc702x_build_sector_list(struct flash_bank *bank)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int aduc702x_erase(struct flash_bank *bank, int first, int last)
|
||||
static int aduc702x_erase(struct flash_bank *bank, unsigned int first,
|
||||
unsigned int last)
|
||||
{
|
||||
/* int res; */
|
||||
int x;
|
||||
|
||||
Reference in New Issue
Block a user