- Fixes '!=' whitespace
- 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@2363 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -269,7 +269,7 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
|
||||
int timeout = (len / 20480 + 1) * 1000; /*asume 20 KB/s*/
|
||||
|
||||
retval=loadDriver(info);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
uint32_t flashErr;
|
||||
@@ -282,7 +282,7 @@ static int eCosBoard_erase(ecosflash_flash_bank_t *info, uint32_t address, uint3
|
||||
&flashErr,
|
||||
timeout
|
||||
);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if (flashErr != 0x0)
|
||||
@@ -302,7 +302,7 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
|
||||
int timeout = (chunk / 20480 + 1) * 1000; /*asume 20 KB/s + 1 second*/
|
||||
|
||||
retval=loadDriver(info);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
uint32_t buffer;
|
||||
@@ -314,7 +314,7 @@ static int eCosBoard_flash(ecosflash_flash_bank_t *info, void *data, uint32_t ad
|
||||
0,
|
||||
&buffer,
|
||||
1000);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ static int flash_driver_write(struct flash_bank_s *bank, uint8_t *buffer, uint32
|
||||
int retval;
|
||||
|
||||
retval=bank->driver->write(bank, buffer, offset, count);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
{
|
||||
LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)",
|
||||
bank->base, offset, retval);
|
||||
@@ -104,7 +104,7 @@ static int flash_driver_erase(struct flash_bank_s *bank, int first, int last)
|
||||
int retval;
|
||||
|
||||
retval=bank->driver->erase(bank, first, last);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
{
|
||||
LOG_ERROR("failed erasing sectors %d to %d (%d)", first, last, retval);
|
||||
}
|
||||
@@ -117,7 +117,7 @@ int flash_driver_protect(struct flash_bank_s *bank, int set, int first, int last
|
||||
int retval;
|
||||
|
||||
retval=bank->driver->protect(bank, set, first, last);
|
||||
if (retval!=ERROR_OK)
|
||||
if (retval != ERROR_OK)
|
||||
{
|
||||
LOG_ERROR("failed setting protection for areas %d to %d (%d)", first, last, retval);
|
||||
}
|
||||
@@ -801,11 +801,11 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
err = flash_driver_write(bank, chunk, address - bank->base + wrote, cur_size);
|
||||
if (err!=ERROR_OK)
|
||||
if (err != ERROR_OK)
|
||||
return err;
|
||||
|
||||
err = target_read_buffer(target, address + wrote, cur_size, readback);
|
||||
if (err!=ERROR_OK)
|
||||
if (err != ERROR_OK)
|
||||
return err;
|
||||
|
||||
unsigned i;
|
||||
|
||||
@@ -526,7 +526,7 @@ static int lpc2000_write(struct flash_bank_s *bank, uint8_t *buffer, uint32_t of
|
||||
LOG_DEBUG("checksum: 0x%8.8" PRIx32, checksum);
|
||||
|
||||
uint32_t original_value=buf_get_u32(buffer + (5 * 4), 0, 32);
|
||||
if (original_value!=checksum)
|
||||
if (original_value != checksum)
|
||||
{
|
||||
LOG_WARNING("Verification will fail since checksum in image(0x%8.8" PRIx32 ") written to flash was different from calculated vector checksum(0x%8.8" PRIx32 ").",
|
||||
original_value, checksum);
|
||||
|
||||
@@ -53,7 +53,7 @@ void cmd_flash(uint32 cmd)
|
||||
chksum=OCL_CHKS_INIT;
|
||||
for (bi=0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
|
||||
|
||||
if (dcc_rd()!=chksum) {
|
||||
if (dcc_rd() != chksum) {
|
||||
dcc_wr(OCL_CHKS_FAIL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ int flash_erase_all(void)
|
||||
{
|
||||
int result;
|
||||
|
||||
if ((result=flash_erase_plane(0))!=FLASH_STAT_OK) return result;
|
||||
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);
|
||||
|
||||
@@ -388,7 +388,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
|
||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||
};
|
||||
|
||||
if ((retval=target_write_buffer(target, pic32mx_info->write_algorithm->address, sizeof(pic32mx_flash_write_code), pic32mx_flash_write_code))!=ERROR_OK)
|
||||
if ((retval=target_write_buffer(target, pic32mx_info->write_algorithm->address, sizeof(pic32mx_flash_write_code), pic32mx_flash_write_code)) != ERROR_OK)
|
||||
return retval;
|
||||
#endif
|
||||
|
||||
@@ -409,7 +409,7 @@ static int pic32mx_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint3
|
||||
{
|
||||
uint32_t status;
|
||||
|
||||
if ((retval = target_write_buffer(target, source->address, buffer_size, buffer))!=ERROR_OK) {
|
||||
if ((retval = target_write_buffer(target, source->address, buffer_size, buffer)) != ERROR_OK) {
|
||||
LOG_ERROR("Failed to write row buffer (%d words) to RAM", (int)(buffer_size/4));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32
|
||||
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
|
||||
};
|
||||
|
||||
if ((retval=target_write_buffer(target, stm32x_info->write_algorithm->address, sizeof(stm32x_flash_write_code), stm32x_flash_write_code))!=ERROR_OK)
|
||||
if ((retval=target_write_buffer(target, stm32x_info->write_algorithm->address, sizeof(stm32x_flash_write_code), stm32x_flash_write_code)) != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
/* memory buffer */
|
||||
@@ -547,7 +547,7 @@ static int stm32x_write_block(struct flash_bank_s *bank, uint8_t *buffer, uint32
|
||||
{
|
||||
uint32_t thisrun_count = (count > (buffer_size / 2)) ? (buffer_size / 2) : count;
|
||||
|
||||
if ((retval = target_write_buffer(target, source->address, thisrun_count * 2, buffer))!=ERROR_OK)
|
||||
if ((retval = target_write_buffer(target, source->address, thisrun_count * 2, buffer)) != ERROR_OK)
|
||||
break;
|
||||
|
||||
buf_set_u32(reg_params[0].value, 0, 32, source->address);
|
||||
|
||||
@@ -198,11 +198,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
|
||||
if (str9x_info->bank1)
|
||||
{
|
||||
adr = bank1start + 0x18;
|
||||
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
|
||||
if ((retval=target_read_u16(target, adr, &hstatus)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
@@ -211,11 +211,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
|
||||
else
|
||||
{
|
||||
adr = bank1start + 0x14;
|
||||
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
if ((retval=target_read_u32(target, adr, &status))!=ERROR_OK)
|
||||
if ((retval=target_read_u32(target, adr, &status)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
@@ -224,11 +224,11 @@ static int str9x_protect_check(struct flash_bank_s *bank)
|
||||
else
|
||||
{
|
||||
adr = bank1start + 0x10;
|
||||
if ((retval=target_write_u16(target, adr, 0x90))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0x90)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
if ((retval=target_read_u16(target, adr, &hstatus))!=ERROR_OK)
|
||||
if ((retval=target_read_u16(target, adr, &hstatus)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ static int str9x_protect_check(struct flash_bank_s *bank)
|
||||
}
|
||||
|
||||
/* read array command */
|
||||
if ((retval=target_write_u16(target, adr, 0xFF))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0xFF)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
@@ -284,24 +284,24 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
|
||||
adr = bank->base + bank->sectors[i].offset;
|
||||
|
||||
/* erase sectors */
|
||||
if ((retval=target_write_u16(target, adr, erase_cmd))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, erase_cmd)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
if ((retval=target_write_u16(target, adr, 0xD0))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0xD0)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* get status */
|
||||
if ((retval=target_write_u16(target, adr, 0x70))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0x70)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
int timeout;
|
||||
for (timeout=0; timeout<1000; timeout++) {
|
||||
if ((retval=target_read_u8(target, adr, &status))!=ERROR_OK)
|
||||
if ((retval=target_read_u8(target, adr, &status)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
@@ -316,13 +316,13 @@ static int str9x_erase(struct flash_bank_s *bank, int first, int last)
|
||||
}
|
||||
|
||||
/* clear status, also clear read array */
|
||||
if ((retval=target_write_u16(target, adr, 0x50))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0x50)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* read array command */
|
||||
if ((retval=target_write_u16(target, adr, 0xFF))!=ERROR_OK)
|
||||
if ((retval=target_write_u16(target, adr, 0xFF)) != ERROR_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user