[PATCH 3/7] disk: define nullified functions for !PARTITIONS

AKASHI Takahiro takahiro.akashi at linaro.org
Tue Apr 19 03:01:54 CEST 2022


Some defconfig enables CMD_PART even if none of any partition table
types (CONFIG_*_PARTITION) are enabled.
This will lead to the size growth in SPL/TPL code since disk/part.c
will be compiled in any way.
We will change disk/Kconfig later so that CONFIG_PARTITIONS is only
enabled when, at least, one of CONFIG_*_PARTITION is enabled.

To make the build work (in particular, "part" command) correctly,
a few functions should be defined as void functions in case of
!CONFIG_PARTITIONS.

Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
---
 include/part.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/part.h b/include/part.h
index 9975fad97121..5f47a76bc19b 100644
--- a/include/part.h
+++ b/include/part.h
@@ -276,6 +276,15 @@ static inline int blk_get_device_part_str(const char *ifname,
 					  struct disk_partition *info,
 					  int allow_whole_dev)
 { *dev_desc = NULL; return -1; }
+static inline int part_get_info_by_name_type(struct blk_desc *dev_desc,
+					     const char *name,
+					     struct disk_partition *info,
+					     int part_type)
+{ return -ENOENT; }
+static inline int part_get_info_by_name(struct blk_desc *dev_desc,
+					const char *name,
+					struct disk_partition *info)
+{ return -ENOENT; }
 static inline int
 part_get_info_by_dev_and_name_or_num(const char *dev_iface,
 				     const char *dev_part_str,
-- 
2.33.0



More information about the U-Boot mailing list