diff options
author | Paul Selkirk <paul@psgd.org> | 2017-10-23 18:05:31 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2017-10-23 18:05:31 -0400 |
commit | ca84af553cbaae45b17cce04d457b2e61cc4277c (patch) | |
tree | 90f2bc5e96d2f1ae3fece3dfb9075edda08c4ace /ks_token.c | |
parent | 12a3c63b75044b207dd7982ce3ed170231bd4467 (diff) |
Cleanup signed/unsigned mismatches, mostly in loop counters
Diffstat (limited to 'ks_token.c')
-rw-r--r-- | ks_token.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |