From 28fa9ca76077ee282a4c6394d338caac81efa8a9 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 23 Dec 2025 22:51:51 +0000 Subject: [PATCH] firmware: fat: fix sector_t passed to 64-bit format strings sector_t is still 32-bit on most targets, resulting in compile warnings on debug builds when used with an %llu/%llx format. Fix by always casting the sector to uint64_t. Change-Id: I5afc4a0ae170981c304274806e00ac07be232cd8 --- firmware/common/fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/common/fat.c b/firmware/common/fat.c index 42fb1def01..b722078c87 100644 --- a/firmware/common/fat.c +++ b/firmware/common/fat.c @@ -2465,7 +2465,7 @@ static long transfer(struct bpb *fat_bpb, sector_t start, long count, long rc = 0; DEBUGF("%s(s=%llx, c=%lx, wr=%u)\n", __func__, - start + fat_bpb->startsector, count, write ? 1 : 0); + (uint64_t)(start + fat_bpb->startsector), count, write ? 1 : 0); if (write) { @@ -2557,7 +2557,7 @@ long fat_readwrite(struct fat_filestr *filestr, unsigned long sectorcount, file->firstcluster, sectorcount, (long)buf, write ? "write":"read"); DEBUGF("%s: sec:%llx numsec:%ld eof:%d\n", __func__, - sector, (long)sectornum, eof ? 1 : 0); + (uint64_t)sector, (long)sectornum, eof ? 1 : 0); eof = false;