瀏覽代碼

cmd_usage: constify

The usage helper doesn't modify the command, so constify its input arg.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger 13 年之前
父節點
當前提交
e84ffddbce
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      common/command.c
  2. 1 1
      include/command.h

+ 1 - 1
common/command.c

@@ -140,7 +140,7 @@ cmd_tbl_t *find_cmd (const char *cmd)
 	return find_cmd_tbl(cmd, &__u_boot_cmd_start, len);
 }
 
-int cmd_usage(cmd_tbl_t *cmdtp)
+int cmd_usage(const cmd_tbl_t *cmdtp)
 {
 	printf("%s - %s\n\n", cmdtp->name, cmdtp->usage);
 

+ 1 - 1
include/command.h

@@ -71,7 +71,7 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
 cmd_tbl_t *find_cmd(const char *cmd);
 cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
 
-extern int cmd_usage(cmd_tbl_t *cmdtp);
+extern int cmd_usage(const cmd_tbl_t *cmdtp);
 
 #ifdef CONFIG_AUTO_COMPLETE
 extern int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]);