aboutsummaryrefslogtreecommitdiff
path: root/src/kinetis.c
diff options
context:
space:
mode:
authorGareth McMullin2015-03-14 15:18:22 -0700
committerGareth McMullin2015-03-14 15:18:22 -0700
commit6f5b1873d7b986fe7b3bc1f267bae9f7649630a5 (patch)
tree81246a079184046887e2accd5585bd916d426584 /src/kinetis.c
parentf5c856af3b3b0155050e793f50c29965d2c8326d (diff)
Use size_t for sizes in flash functions. Fix all sign compare warnings.
Diffstat (limited to 'src/kinetis.c')
-rw-r--r--src/kinetis.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/kinetis.c b/src/kinetis.c
index 4b7cf31..b260d2a 100644
--- a/src/kinetis.c
+++ b/src/kinetis.c
@@ -54,9 +54,9 @@
#define KL25_PAGESIZE 0x400
-static int kl25_flash_erase(struct target_s *target, uint32_t addr, int len);
+static int kl25_flash_erase(struct target_s *target, uint32_t addr, size_t len);
static int kl25_flash_write(struct target_s *target, uint32_t dest,
- const uint8_t *src, int len);
+ const uint8_t *src, size_t len);
static const char kl25_xml_memory_map[] = "<?xml version=\"1.0\"?>"
/* "<!DOCTYPE memory-map "
@@ -121,7 +121,7 @@ kl25_command(struct target_s *t, uint8_t cmd, uint32_t addr, const uint8_t data[
return true;
}
-static int kl25_flash_erase(struct target_s *t, uint32_t addr, int len)
+static int kl25_flash_erase(struct target_s *t, uint32_t addr, size_t len)
{
addr &= ~(KL25_PAGESIZE - 1);
len = (len + KL25_PAGESIZE - 1) & ~(KL25_PAGESIZE - 1);
@@ -135,7 +135,7 @@ static int kl25_flash_erase(struct target_s *t, uint32_t addr, int len)
}
static int kl25_flash_write(struct target_s *t, uint32_t dest,
- const uint8_t *src, int len)
+ const uint8_t *src, size_t len)
{
/* FIXME handle misaligned start and end of sections */
if ((dest & 3) || (len & 3))