[PATCH 2/2] fs: exfat: Inhibit unused exfat_humanize_bytes() and exfat_print_info()

Marek Vasut marex at denx.de
Wed Apr 30 18:45:52 CEST 2025


Make sure unused exfat_humanize_bytes() and exfat_print_info()
functions are not compiled into U-Boot code base. This also removes
CID 550300:  Integer handling issues  (INTEGER_OVERFLOW)
in exfat_humanize_bytes() , which is now surely unreachable.

Signed-off-by: Marek Vasut <marex at denx.de>
---
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 fs/exfat/exfat.h | 2 ++
 fs/exfat/utils.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/fs/exfat/exfat.h b/fs/exfat/exfat.h
index cce3e3021ca..ca6f22b9d58 100644
--- a/fs/exfat/exfat.h
+++ b/fs/exfat/exfat.h
@@ -210,9 +210,11 @@ uint32_t exfat_vbr_start_checksum(const void* sector, size_t size);
 uint32_t exfat_vbr_add_checksum(const void* sector, size_t size, uint32_t sum);
 le16_t exfat_calc_name_hash(const struct exfat* ef, const le16_t* name,
 		size_t length);
+#ifndef __UBOOT__
 void exfat_humanize_bytes(uint64_t value, struct exfat_human_bytes* hb);
 void exfat_print_info(const struct exfat_super_block* sb,
 		uint32_t free_clusters);
+#endif
 bool exfat_match_option(const char* options, const char* option_name);
 
 int exfat_utf16_to_utf8(char* output, const le16_t* input, size_t outsize,
diff --git a/fs/exfat/utils.c b/fs/exfat/utils.c
index 0d97b65dcab..f99dcba7e3d 100644
--- a/fs/exfat/utils.c
+++ b/fs/exfat/utils.c
@@ -134,6 +134,7 @@ le16_t exfat_calc_name_hash(const struct exfat* ef, const le16_t* name,
 	return cpu_to_le16(hash);
 }
 
+#ifndef __UBOOT__
 void exfat_humanize_bytes(uint64_t value, struct exfat_human_bytes* hb)
 {
 	size_t i;
@@ -178,6 +179,7 @@ void exfat_print_info(const struct exfat_super_block* sb,
 	exfat_humanize_bytes(avail_space, &hb);
 	printf("Available space      %10"PRIu64" %s\n", hb.value, hb.unit);
 }
+#endif
 
 bool exfat_match_option(const char* options, const char* option_name)
 {
-- 
2.47.2



More information about the U-Boot mailing list