[PATCH 1/3] cmd/sqfs.c, include/fs.h: fix build failures, don't expose do_sqfs_*() functions globally

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Jul 15 22:11:41 CEST 2020


The cmd_tbl_t type has been removed upstream since commit 09140113108
("command: Remove the cmd_tbl_t typedef"), so we must use "struct
cmd_tbl" instead.

The <command.h> include was missing in cmd/sqfs.c, without which
U_BOOT_CMD() is not defined.

Finally, there is no reason to globally expose do_sqfs_ls() and
do_sqfs_load(), they are only used within cmd/sqfs.c. This allows to
drop the do_sqfs_load() prototype from include/fs.h.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 cmd/sqfs.c   |  5 +++--
 include/fs.h | 12 ------------
 2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/cmd/sqfs.c b/cmd/sqfs.c
index af42df728b..177008e802 100644
--- a/cmd/sqfs.c
+++ b/cmd/sqfs.c
@@ -7,10 +7,11 @@
  * squashfs.c:	implements SquashFS related commands
  */
 
+#include <command.h>
 #include <fs.h>
 #include <squashfs.h>
 
-int do_sqfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sqfs_ls(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
 {
 	return do_ls(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
 }
@@ -22,7 +23,7 @@ U_BOOT_CMD(
 	"    - list files from 'dev' on 'interface' in 'directory'\n"
 );
 
-int do_sqfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sqfs_load(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
 {
 	return do_load(cmdtp, flag, argc, argv, FS_TYPE_SQUASHFS);
 }
diff --git a/include/fs.h b/include/fs.h
index 19f4afc482..0794b50d10 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -42,18 +42,6 @@ int do_fat_fsload(struct cmd_tbl *cmdtp, int flag, int argc,
  */
 int do_ext2load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
 
-
-/**
- * do_sqfs_load - Run the sqfsload command
- *
- * @cmdtp: Command information for sqfsload
- * @flag: Command flags (CMD_FLAG_...)
- * @argc: Number of arguments
- * @argv: List of arguments
- * @return result (see enum command_ret_t)
- */
-int do_sqfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]);
-
 /*
  * Tell the fs layer which block device an partition to use for future
  * commands. This also internally identifies the filesystem that is present
-- 
2.26.2



More information about the U-Boot mailing list