Skip to content

Commit 8b7c7cc

Browse files
rbrscolemannordicjm
authored andcommitted
zephyr: flash map: fix comparison signedness
This resolves a warning when building with `-Wsign-compare`. `struct flash_area.fa_size` is declared as `size_t` in the Zephyr source tree (in `include/zephyr/storage/flash_map.h`). Signed-off-by: Samuel Coleman <[email protected]>
1 parent b92d4dd commit 8b7c7cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/zephyr/flash_map_extended.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int flash_area_get_sector(const struct flash_area *fap, off_t off,
178178
struct flash_pages_info fpi;
179179
int rc;
180180

181-
if (off >= fap->fa_size) {
181+
if (off < 0 || (size_t) off >= fap->fa_size) {
182182
return -ERANGE;
183183
}
184184

0 commit comments

Comments
 (0)