1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 18:13:49 +01:00
RIOT/pkg/esp32_sdk/patches/0015-hal-fix-signed-unsigned-comparison.patch
2025-05-27 23:25:36 +02:00

40 lines
1.9 KiB
Diff

From f504db165a55f83e9d253194a1b880b2a5f746c4 Mon Sep 17 00:00:00 2001
From: Gunar Schorcht <gunar@schorcht.net>
Date: Sat, 1 Mar 2025 18:03:20 +0100
Subject: [PATCH 15/28] hal: fix signed/unsigned comparison
---
components/hal/esp32c3/include/hal/gpspi_flash_ll.h | 2 +-
components/hal/esp32c3/include/hal/spimem_flash_ll.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/components/hal/esp32c3/include/hal/gpspi_flash_ll.h b/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
index 18465d85f1..2d2934b97d 100644
--- a/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
+++ b/components/hal/esp32c3/include/hal/gpspi_flash_ll.h
@@ -85,7 +85,7 @@ static inline void gpspi_flash_ll_get_buffer_data(spi_dev_t *dev, void *buffer,
} else {
// Otherwise, slow(er) path copies word by word
int copy_len = read_len;
- for (int i = 0; i < (read_len + 3) / 4; i++) {
+ for (uint32_t i = 0; i < (read_len + 3) / 4; i++) {
int word_len = MIN(sizeof(uint32_t), copy_len);
uint32_t word = dev->data_buf[i];
memcpy(buffer, &word, word_len);
diff --git a/components/hal/esp32c3/include/hal/spimem_flash_ll.h b/components/hal/esp32c3/include/hal/spimem_flash_ll.h
index fd9bc38ed9..c643919bb0 100644
--- a/components/hal/esp32c3/include/hal/spimem_flash_ll.h
+++ b/components/hal/esp32c3/include/hal/spimem_flash_ll.h
@@ -332,7 +332,7 @@ static inline void spimem_flash_ll_get_buffer_data(spi_mem_dev_t *dev, void *buf
} else {
// Otherwise, slow(er) path copies word by word
int copy_len = read_len;
- for (int i = 0; i < (read_len + 3) / 4; i++) {
+ for (uint32_t i = 0; i < (read_len + 3) / 4; i++) {
int word_len = MIN(sizeof(uint32_t), copy_len);
uint32_t word = dev->data_buf[i];
memcpy(buffer, &word, word_len);
--
2.34.1