diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 04a51db..d473e17 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -9,6 +9,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <inttypes.h>
 #include <common.h>
 #include <config.h>
 #include <exports.h>
@@ -184,7 +185,7 @@ static __u32 get_fatent(fsdata *mydata, __u32 entry)
 		return ret;
 	}
 
-	debug("FAT%d: entry: 0x%04x = %d, offset: 0x%04x = %d\n",
+	debug("FAT%d: entry: 0x%04" PRIx32 " = %" PRId32 ", offset: 0x%04" PRIx32 " = %" PRId32 "\n",
 	       mydata->fatsize, entry, entry, offset, offset);
 
 	/* Read a new block of FAT entries into the cache. */
@@ -245,7 +246,7 @@ static __u32 get_fatent(fsdata *mydata, __u32 entry)
 		}
 		break;
 	}
-	debug("FAT%d: ret: %08x, offset: %04x\n",
+	debug("FAT%d: ret: %08" PRIx32 ", offset: %04" PRIx32 "\n",
 	       mydata->fatsize, ret, offset);
 
 	return ret;
@@ -269,7 +270,7 @@ get_cluster(fsdata *mydata, __u32 clustnum, __u8 *buffer, unsigned long size)
 		startsect = mydata->rootdir_sect;
 	}
 
-	debug("gc - clustnum: %d, startsect: %d\n", clustnum, startsect);
+	debug("gc - clustnum: %" PRId32 ", startsect: %" PRId32 "\n", clustnum, startsect);
 
 	if ((unsigned long)buffer & (ARCH_DMA_MINALIGN - 1)) {
 		ALLOC_CACHE_ALIGN_BUFFER(__u8, tmpbuf, mydata->sect_size);
@@ -350,7 +351,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
 	while (actsize <= pos) {
 		curclust = get_fatent(mydata, curclust);
 		if (CHECK_CLUST(curclust, mydata->fatsize)) {
-			debug("curclust: 0x%x\n", curclust);
+			debug("curclust: 0x%" PRIx32 "\n", curclust);
 			debug("Invalid FAT entry\n");
 			return 0;
 		}
@@ -380,7 +381,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
 
 		curclust = get_fatent(mydata, curclust);
 		if (CHECK_CLUST(curclust, mydata->fatsize)) {
-			debug("curclust: 0x%x\n", curclust);
+			debug("curclust: 0x%" PRIx32 "\n", curclust);
 			debug("Invalid FAT entry\n");
 			return 0;
 		}
@@ -396,7 +397,7 @@ static int get_contents(fsdata *mydata, dir_entry *dentptr, loff_t pos,
 			if ((newclust - 1) != endclust)
 				goto getit;
 			if (CHECK_CLUST(newclust, mydata->fatsize)) {
-				debug("curclust: 0x%x\n", newclust);
+				debug("curclust: 0x%" PRIx32 "\n", newclust);
 				debug("Invalid FAT entry\n");
 				return 0;
 			}
@@ -423,7 +424,7 @@ getit:
 
 		curclust = get_fatent(mydata, endclust);
 		if (CHECK_CLUST(curclust, mydata->fatsize)) {
-			debug("curclust: 0x%x\n", curclust);
+			debug("curclust: 0x%" PRIx32 "\n", curclust);
 			printf("Invalid FAT entry\n");
 			return 0;
 		}
@@ -633,7 +634,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 						}
 						if (doit) {
 							if (dirc == ' ') {
-								printf(" %8u   %s%c\n",
+								printf(" %8" PRIu32 "%s%c\n",
 								       FAT2CPU32(dentptr->size),
 									l_name,
 									dirc);
@@ -690,7 +691,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 
 				if (doit) {
 					if (dirc == ' ') {
-						printf(" %8u   %s%c\n",
+						printf(" %8" PRIu32 "%s%c\n",
 						       FAT2CPU32(dentptr->size),
 							s_name, dirc);
 					} else {
@@ -714,7 +715,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 
 			debug("DentName: %s", s_name);
 			debug(", start: 0x%x", START(dentptr));
-			debug(", size:  0x%x %s\n",
+			debug(", size:  0x%" PRIx32 " %s\n",
 			      FAT2CPU32(dentptr->size),
 			      (dentptr->attr & ATTR_DIR) ? "(DIR)" : "");
 
@@ -723,7 +724,7 @@ static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 
 		curclust = get_fatent(mydata, curclust);
 		if (CHECK_CLUST(curclust, mydata->fatsize)) {
-			debug("curclust: 0x%x\n", curclust);
+			debug("curclust: 0x%" PRIx32 "\n", curclust);
 			printf("Invalid FAT entry\n");
 			return NULL;
 		}
@@ -874,7 +875,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 	if (vfat_enabled)
 		debug("VFAT Support enabled\n");
 
-	debug("FAT%d, fat_sect: %d, fatlength: %d\n",
+	debug("FAT%d, fat_sect: %d, fatlength: %" PRId32 "\n",
 	       mydata->fatsize, mydata->fat_sect, mydata->fatlength);
 	debug("Rootdir begins at cluster: %d, sector: %d, offset: %x\n"
 	       "Data begins at: %d\n",
@@ -914,7 +915,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 		int i;
 
 		if (j == 0) {
-			debug("FAT read sect=%d, clust_size=%d, DIRENTSPERBLOCK=%zd\n",
+			debug("FAT read sect=%" PRId32 ", clust_size=%d, DIRENTSPERBLOCK=%zd\n",
 				cursect, mydata->clust_size, DIRENTSPERBLOCK);
 
 			if (disk_read(cursect,
@@ -973,7 +974,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 						}
 						if (doit) {
 							if (dirc == ' ') {
-								printf(" %8u   %s%c\n",
+								printf(" %8" PRIu32 "   %s%c\n",
 								       FAT2CPU32(dentptr->size),
 									l_name,
 									dirc);
@@ -1031,7 +1032,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 				}
 				if (doit) {
 					if (dirc == ' ') {
-						printf(" %8u   %s%c\n",
+						printf(" %8" PRIu32 "   %s%c\n",
 						       FAT2CPU32(dentptr->size),
 							s_name, dirc);
 					} else {
@@ -1056,7 +1057,7 @@ int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 
 			debug("RootName: %s", s_name);
 			debug(", start: 0x%x", START(dentptr));
-			debug(", size:  0x%x %s\n",
+			debug(", size:  0x%" PRIx32 " %s\n",
 			       FAT2CPU32(dentptr->size),
 			       isdir ? "(DIR)" : "");
 
@@ -1157,7 +1158,7 @@ rootdir_done:
 	} else {
 		ret = get_contents(mydata, dentptr, pos, buffer, maxsize, size);
 	}
-	debug("Size: %u, got: %llu\n", FAT2CPU32(dentptr->size), *size);
+	debug("Size: %" PRIu32 ", got: %llu\n", FAT2CPU32(dentptr->size), *size);
 
 exit:
 	free(mydata->fatbuf);
diff --git a/include/u-boot/zlib.h b/include/u-boot/zlib.h
index e23ceb5..bf09b6f 100644
--- a/include/u-boot/zlib.h
+++ b/include/u-boot/zlib.h
@@ -694,7 +694,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
    seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
 */
 
-ZEXTERN  uInt ZEXPORT crc32  OF((uInt crc, const Bytef *buf, uInt len));
+ZEXTERN  uint32_t ZEXPORT crc32  OF((uint32_t crc, const Bytef *buf, uInt len));
 /*
      Update a running CRC-32 with the bytes buf[0..len-1] and return the
    updated CRC-32. If buf is NULL, this function returns the required initial
