From 6d1d58a1fc3dfd60e9cac89460b5a6e438d11efa Mon Sep 17 00:00:00 2001 From: zwelch Date: Tue, 23 Jun 2009 22:45:47 +0000 Subject: - Fixes '[<>]' whitespace - Replace ')\([<>]\)(' with ') \1 ('. - Replace ')\([<>]\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\([<>]\)(' with '\1 \2 ('. - Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/at91sam7.c | 24 ++++++++++++------------ src/flash/cfi.c | 4 ++-- src/flash/ecos.c | 4 ++-- src/flash/flash.c | 4 ++-- src/flash/flash.h | 2 +- src/flash/ocl.c | 4 ++-- src/flash/ocl/at91sam7x/main.c | 8 ++++---- src/flash/ocl/at91sam7x/samflash.c | 4 ++-- src/flash/stellaris.c | 2 +- src/flash/str9x.c | 6 +++--- 10 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/flash') diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c index 8be4bc95..bb2a28f5 100644 --- a/src/flash/at91sam7.c +++ b/src/flash/at91sam7.c @@ -550,7 +550,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) /* calculate bank size */ bank_size = sectors_num * pages_per_sector * page_size; - for (bnk = 0; bnk 0) { @@ -575,7 +575,7 @@ static int at91sam7_read_part_info(struct flash_bank_s *bank) /* allocate sectors */ t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t)); - for (sec = 0; secsectors[sec].offset = sec * pages_per_sector * page_size; t_bank->sectors[sec].size = pages_per_sector * page_size; @@ -639,7 +639,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH); fast_check = 1; - for (nSector = 0; nSectornum_sectors; nSector++) + for (nSector = 0; nSector < bank->num_sectors; nSector++) { retval = target_blank_check_memory(target, bank->base + bank->sectors[nSector].offset, bank->sectors[nSector].size, &blank); @@ -662,7 +662,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) LOG_USER("Running slow fallback erase check - add working memory"); buffer = malloc(bank->sectors[0].size); - for (nSector = 0; nSectornum_sectors; nSector++) + for (nSector = 0; nSector < bank->num_sectors; nSector++) { bank->sectors[nSector].is_erased = 1; retval = target_read_memory(target, bank->base + bank->sectors[nSector].offset, 4, @@ -670,7 +670,7 @@ static int at91sam7_erase_check(struct flash_bank_s *bank) if (retval != ERROR_OK) return retval; - for (nByte = 0; nBytesectors[nSector].size; nByte++) + for (nByte = 0; nByte < bank->sectors[nSector].size; nByte++) { if (buffer[nByte] != 0xFF) { @@ -705,7 +705,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) at91sam7_info->lockbits = (status >> 16); at91sam7_info->num_lockbits_on = 0; - for (lock_pos = 0; lock_posnum_sectors; lock_pos++) + for (lock_pos = 0; lock_pos < bank->num_sectors; lock_pos++) { if ( ((status >> (16 + lock_pos))&(0x0001)) == 1) { @@ -723,7 +723,7 @@ static int at91sam7_protect_check(struct flash_bank_s *bank) at91sam7_info->nvmbits = (status >> 8)&0xFF; at91sam7_info->num_nvmbits_on = 0; - for (gpnvm_pos = 0; gpnvm_posnum_nvmbits; gpnvm_pos++) + for (gpnvm_pos = 0; gpnvm_pos < at91sam7_info->num_nvmbits; gpnvm_pos++) { if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1) { @@ -809,7 +809,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char * /* calculate bank size */ bank_size = num_sectors * pages_per_sector * page_size; - for (bnk = 0; bnk 0) { @@ -834,7 +834,7 @@ static int at91sam7_flash_bank_command(struct command_context_s *cmd_ctx, char * /* allocate sectors */ t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t)); - for (sec = 0; secsectors[sec].offset = sec * pages_per_sector * page_size; t_bank->sectors[sec].size = pages_per_sector * page_size; @@ -902,7 +902,7 @@ static int at91sam7_erase(struct flash_bank_s *bank, int first, int last) /* allocate and clean buffer */ nbytes = (last - first + 1) * bank->sectors[first].size; buffer = malloc(nbytes * sizeof(uint8_t)); - for (pos = 0; posx16_as_x8) { uint8_t i; - for (i = 0;i<2;i++) + for (i = 0;i < 2;i++) target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1, &data[i*bank->bus_width] ); } @@ -234,7 +234,7 @@ static uint32_t cfi_query_u32(flash_bank_t *bank, int sector, uint32_t offset) if (cfi_info->x16_as_x8) { uint8_t i; - for (i = 0;i<4;i++) + for (i = 0;i < 4;i++) target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1, &data[i*bank->bus_width] ); } diff --git a/src/flash/ecos.c b/src/flash/ecos.c index 1a2aa68d..0f1752b6 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -319,10 +319,10 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad uint32_t i; - for (i = 0; ichunk) + if (t > chunk) { t = chunk; } diff --git a/src/flash/flash.c b/src/flash/flash.c index a850ced9..5ca26622 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -791,7 +791,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm duration_start_measure(&duration); - for (wrote = 0; wrote<(count*wordsize); wrote += cur_size) + for (wrote = 0; wrote < (count*wordsize); wrote += cur_size) { cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) ); flash_bank_t *bank; @@ -809,7 +809,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm return err; unsigned i; - for (i = 0; iflash_driver_callback() + * corresponding static flash_driver_ < i>callback () * routine in flash.c. */ typedef struct flash_driver_s diff --git a/src/flash/ocl.c b/src/flash/ocl.c index 06cbbaad..a2dac50a 100644 --- a/src/flash/ocl.c +++ b/src/flash/ocl.c @@ -200,7 +200,7 @@ static int ocl_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t offset chksum = OCL_CHKS_INIT; /* copy data to DCC buffer in proper byte order and properly aligned */ - for (i = 0; isize / bank->num_sectors; - for (i = 0; inum_sectors; i++) + for (i = 0; i < bank->num_sectors; i++) { bank->sectors[i].offset = i * sectsize; bank->sectors[i].size = sectsize; diff --git a/src/flash/ocl/at91sam7x/main.c b/src/flash/ocl/at91sam7x/main.c index c675b20a..2146d74e 100644 --- a/src/flash/ocl/at91sam7x/main.c +++ b/src/flash/ocl/at91sam7x/main.c @@ -45,13 +45,13 @@ void cmd_flash(uint32 cmd) bi_start = ofs/4; bi_end = (ofs + len + 3)/4; - if (bi_end>BUFSIZE) { + if (bi_end > BUFSIZE) { dcc_wr(OCL_BUFF_OVER); return; } chksum = OCL_CHKS_INIT; - for (bi = 0; biflash_page_count) break; + if ((page_num += flash_lock_pages) > flash_page_count) break; lockbits>>=1; } @@ -178,7 +178,7 @@ int flash_erase_all(void) if ((result = flash_erase_plane(0)) != FLASH_STAT_OK) return result; /* the second flash controller, if any */ - if (flash_page_count>1024) result = flash_erase_plane(0x10); + if (flash_page_count > 1024) result = flash_erase_plane(0x10); return result; } diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c index d06aa9a5..4e76b0e6 100644 --- a/src/flash/stellaris.c +++ b/src/flash/stellaris.c @@ -322,7 +322,7 @@ static int stellaris_info(struct flash_bank_s *bank, char *buf, int buf_size) buf += printed; buf_size -= printed; - if (stellaris_info->num_lockbits>0) + if (stellaris_info->num_lockbits > 0) { printed = snprintf(buf, buf_size, diff --git a/src/flash/str9x.c b/src/flash/str9x.c index cfd37b9d..1911b59a 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -300,7 +300,7 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last) } int timeout; - for (timeout = 0; timeout<1000; timeout++) { + for (timeout = 0; timeout < 1000; timeout++) { if ((retval = target_read_u8(target, adr, &status)) != ERROR_OK) { return retval; @@ -575,7 +575,7 @@ static int str9x_write(struct flash_bank_s *bank, target_write_u16(target, bank_adr, 0x70); int timeout; - for (timeout = 0; timeout<1000; timeout++) + for (timeout = 0; timeout < 1000; timeout++) { target_read_u8(target, bank_adr, &status); if ( status & 0x80 ) @@ -624,7 +624,7 @@ static int str9x_write(struct flash_bank_s *bank, target_write_u16(target, bank_adr, 0x70); int timeout; - for (timeout = 0; timeout<1000; timeout++) + for (timeout = 0; timeout < 1000; timeout++) { target_read_u8(target, bank_adr, &status); if ( status & 0x80 ) -- cgit v1.2.3