summaryrefslogtreecommitdiff
path: root/src/flash/cfi.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-19 08:16:58 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-04-19 08:16:58 +0000
commita88532bc6061ccc74ca08de161ec6fecf88a85b0 (patch)
tree7a1b0d1cf802cb5ed794340519d7103ec6270cd7 /src/flash/cfi.c
parent7d6b4b42f61debb058013c4179f29f7fa09d8548 (diff)
downloadopenocd+libswd-a88532bc6061ccc74ca08de161ec6fecf88a85b0.tar.gz
openocd+libswd-a88532bc6061ccc74ca08de161ec6fecf88a85b0.tar.bz2
openocd+libswd-a88532bc6061ccc74ca08de161ec6fecf88a85b0.tar.xz
openocd+libswd-a88532bc6061ccc74ca08de161ec6fecf88a85b0.zip
Zach Welch <zw@superlucidity.net> fix signed/unsigned comparisons
git-svn-id: svn://svn.berlios.de/openocd/trunk@1466 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash/cfi.c')
-rw-r--r--src/flash/cfi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flash/cfi.c b/src/flash/cfi.c
index 8f456b15..6b777fa8 100644
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -1113,7 +1113,7 @@ static int cfi_intel_write_block(struct flash_bank_s *bank, u8 *buffer, u32 addr
};
u8 target_code[4*CFI_MAX_INTEL_CODESIZE];
const u32 *target_code_src;
- int target_code_size;
+ u32 target_code_size;
int retval = ERROR_OK;
@@ -1969,7 +1969,7 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
bufferwsize/=(bank->bus_width / bank->chip_width);
/* fall back to memory writes */
- while (count >= bank->bus_width)
+ while (count >= (u32)bank->bus_width)
{
int fallback;
if ((write_p & 0xff) == 0)
@@ -2268,7 +2268,7 @@ static int cfi_probe(struct flash_bank_s *bank)
LOG_DEBUG("size: 0x%x, interface desc: %i, max buffer write size: %x", 1 << cfi_info->dev_size, cfi_info->interface_desc, (1 << cfi_info->max_buf_write_size));
- if (((1 << cfi_info->dev_size) * bank->bus_width / bank->chip_width) != bank->size)
+ if ((u32)((1 << cfi_info->dev_size) * bank->bus_width / bank->chip_width) != bank->size)
{
LOG_WARNING("configuration specifies 0x%x size, but a 0x%x size flash was found", bank->size, 1 << cfi_info->dev_size);
}
@@ -2361,7 +2361,7 @@ static int cfi_probe(struct flash_bank_s *bank)
for (i = 0; i < cfi_info->num_erase_regions; i++)
{
- int j;
+ u32 j;
for (j = 0; j < (cfi_info->erase_region_info[i] & 0xffff) + 1; j++)
{
bank->sectors[sector].offset = offset;