summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/ecos.c8
-rw-r--r--src/flash/flash.c10
-rw-r--r--src/flash/lpc2000.c2
-rw-r--r--src/flash/ocl/at91sam7x/main.c2
-rw-r--r--src/flash/ocl/at91sam7x/samflash.c2
-rw-r--r--src/flash/pic32mx.c4
-rw-r--r--src/flash/stm32x.c4
-rw-r--r--src/flash/str9x.c26
8 files changed, 29 insertions, 29 deletions
diff --git a/src/flash/ecos.c b/src/flash/ecos.c
index e19ac9b0..5d1badd6 100644
--- a/src/flash/ecos.c
+++ b/src/flash/ecos.c
@@ -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;
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 796af715..d5bdf60e 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -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;
diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c
index 28fe0875..d352d26a 100644
--- a/src/flash/lpc2000.c
+++ b/src/flash/lpc2000.c
@@ -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);
diff --git a/src/flash/ocl/at91sam7x/main.c b/src/flash/ocl/at91sam7x/main.c
index 2a4d28bb..3d88d91a 100644
--- a/src/flash/ocl/at91sam7x/main.c
+++ b/src/flash/ocl/at91sam7x/main.c
@@ -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;
}
diff --git a/src/flash/ocl/at91sam7x/samflash.c b/src/flash/ocl/at91sam7x/samflash.c
index a48e6cfd..81c1801d 100644
--- a/src/flash/ocl/at91sam7x/samflash.c
+++ b/src/flash/ocl/at91sam7x/samflash.c
@@ -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);
diff --git a/src/flash/pic32mx.c b/src/flash/pic32mx.c
index 65bdef1c..9ed1aef1 100644
--- a/src/flash/pic32mx.c
+++ b/src/flash/pic32mx.c
@@ -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;
}
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index dd1c1d8c..431d3b02 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -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);
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index 0a75c953..19c0f1ef 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -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;
}