global: fix sign-compare warnings

This commit is contained in:
morris
2020-11-17 12:48:35 +08:00
parent 6504d89050
commit 753a929525
103 changed files with 221 additions and 215 deletions

View File

@@ -55,7 +55,7 @@ void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data,
while (REG_READ(SHA_256_BUSY_REG) != 0) { }
// Copy to memory block
for (int i = 0; i < copy_words; i++) {
for (size_t i = 0; i < copy_words; i++) {
sha_text_reg[block_count + i] = __builtin_bswap32(w[i]);
}
asm volatile ("memw");
@@ -117,7 +117,7 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
uint32_t *digest_words = (uint32_t *)digest;
uint32_t *sha_text_reg = (uint32_t *)(SHA_TEXT_BASE);
for (int i = 0; i < DIGEST_WORDS; i++) {
for (size_t i = 0; i < DIGEST_WORDS; i++) {
digest_words[i] = __builtin_bswap32(sha_text_reg[i]);
}
asm volatile ("memw");

View File

@@ -76,7 +76,7 @@ static bool secure_boot_generate(uint32_t image_len){
ESP_LOGE(TAG, "bootloader_mmap(0x1000, 0x%x) failed", image_len);
return false;
}
for (int i = 0; i < image_len; i+= sizeof(digest.iv)) {
for (size_t i = 0; i < image_len; i+= sizeof(digest.iv)) {
ets_secure_boot_hash(&image[i/sizeof(uint32_t)]);
}
bootloader_munmap(image);