aboutsummaryrefslogtreecommitdiff
path: root/ks_token.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-10-23 18:05:31 -0400
committerPaul Selkirk <paul@psgd.org>2017-10-23 18:05:31 -0400
commitca84af553cbaae45b17cce04d457b2e61cc4277c (patch)
tree90f2bc5e96d2f1ae3fece3dfb9075edda08c4ace /ks_token.c
parent12a3c63b75044b207dd7982ce3ed170231bd4467 (diff)
Cleanup signed/unsigned mismatches, mostly in loop counters
Diffstat (limited to 'ks_token.c')
-rw-r--r--ks_token.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ks_token.c b/ks_token.c
index b96d279..4950f0b 100644
--- a/ks_token.c
+++ b/ks_token.c
@@ -404,7 +404,7 @@ hal_ks_t * const hal_ks_token = &_db.ks;
void hal_ks_init_read_only_pins_only(void)
{
- unsigned b, best_seen = ~0;
+ unsigned b, best_seen = NUM_FLASH_BLOCKS;
hal_ks_block_t block[1];
hal_ks_lock();
@@ -418,11 +418,11 @@ void hal_ks_init_read_only_pins_only(void)
break;
}
- if (b != best_seen && best_seen != ~0 &&
+ if (b != best_seen && best_seen != NUM_FLASH_BLOCKS &&
hal_ks_block_read(hal_ks_token, best_seen, block) != HAL_OK)
- best_seen = ~0;
+ best_seen = NUM_FLASH_BLOCKS;
- if (best_seen == ~0) {
+ if (best_seen == NUM_FLASH_BLOCKS) {
memset(block, 0xFF, sizeof(*block));
block->pin.wheel_pin = hal_last_gasp_pin;
}