Commit 088f1b199112c7ec1bb8f94547f6a21107623f1d
Committed by
Tom Rini
1 parent
2f220500a4
Exists in
master
and in
54 other branches
common/cmd_*.c: sparse fixes
cmd_boot.c:40:5: warning: symbol 'do_go' was not declared. Should it be static? cmd_bootm.c:164:6: warning: symbol '__arch_preboot_os' was not declared. Should it be static? cmd_bootm.c:477:5: warning: symbol 'do_bootm_subcommand' was not declared. Should it be static? cmd_bootm.c:1022:1: error: directive in argument list cmd_bootm.c:1028:1: error: directive in argument list cmd_bootm.c:1029:1: error: directive in argument list cmd_bootm.c:1036:1: error: directive in argument list cmd_bootm.c:1042:1: error: directive in argument list cmd_bootm.c:1044:1: error: directive in argument list cmd_bootm.c:1045:1: error: directive in argument list cmd_bootm.c:1047:1: error: directive in argument list cmd_bootm.c:1089:5: warning: symbol 'do_iminfo' was not declared. Should it be static? cmd_bootm.c:1176:5: warning: symbol 'do_imls' was not declared. Should it be static? cmd_bootm.c:1654:1: error: directive in argument list cmd_bootm.c:1660:1: error: directive in argument list cmd_console.c:32:5: warning: symbol 'do_coninfo' was not declared. Should it be s cmd_date.c:46:5: warning: symbol 'do_date' was not declared. Should it be static? cmd_echo.c:27:5: warning: symbol 'do_echo' was not declared. Should it be static? cmd_exit.c:27:5: warning: symbol 'do_exit' was not declared. Should it be static? cmd_fat.c:97:5: warning: symbol 'do_fat_ls' was not declared. Should it be static? cmd_fat.c:136:5: warning: symbol 'do_fat_fsinfo' was not declared. Should it be s cmd_fdt.c:66:5: warning: symbol 'do_fdt' was not declared. Should it be static? cmd_fdt.c:542:43: warning: incorrect type in assignment (different base types) cmd_fdt.c:542:43: expected unsigned int [unsigned] [usertype] <noident> cmd_fdt.c:542:43: got restricted __be32 [usertype] <noident> cmd_fdt.c:679:42: warning: cast to restricted __be32 cmd_fdt.c:820:1: error: directive in argument list cmd_fdt.c:822:1: error: directive in argument list cmd_flash.c:292:5: warning: symbol 'do_flinfo' was not declared. Should it be static? cmd_flash.c:324:5: warning: symbol 'do_flerase' was not declared. Should it be static? cmd_flash.c:457:5: warning: symbol 'do_protect' was not declared. Should it be st cmd_help.c:27:5: warning: symbol 'do_help' was not declared. Should it be static? cmd_i2c.c:136:6: warning: symbol '__def_i2c_init_board' was not declared. Should it be static? cmd_i2c.c:144:14: warning: symbol '__def_i2c_get_bus_speed' was not declared. Should it be static? cmd_i2c.c:151:5: warning: symbol '__def_i2c_set_bus_speed' was not declared. Should it be static? cmd_i2c.c:1322:1: error: directive in argument list cmd_i2c.c:1324:1: error: directive in argument list cmd_i2c.c:1326:1: error: directive in argument list cmd_i2c.c:1328:1: error: directive in argument list cmd_i2c.c:1337:1: error: directive in argument list cmd_i2c.c:1339:1: error: directive in argument list cmd_irq.c:27:5: warning: symbol 'do_interrupts' was not declared. Should it be static? cmd_itest.c:133:5: warning: symbol 'binary_test' was not declared. Should it be static? cmd_itest.c:158:5: warning: symbol 'do_itest' was not declared. Should it be stat cmd_load.c:54:5: warning: symbol 'do_load_serial' was not declared. Should it be static? cmd_load.c:431:6: warning: symbol 'his_eol' was not declared. Should it be static? cmd_load.c:432:6: warning: symbol 'his_pad_count' was not declared. Should it be static? cmd_load.c:433:6: warning: symbol 'his_pad_char' was not declared. Should it be static? cmd_load.c:434:6: warning: symbol 'his_quote' was not declared. Should it be static? cmd_load.c:436:5: warning: symbol 'do_load_serial_bin' was not declared. Should it be static? cmd_load.c:549:6: warning: symbol 'send_pad' was not declared. Should it be static? cmd_load.c:558:6: warning: symbol 'ktrans' was not declared. Should it be static? cmd_load.c:568:5: warning: symbol 'chk1' was not declared. Should it be static? cmd_load.c:578:6: warning: symbol 's1_sendpacket' was not declared. Should it be static? cmd_load.c:587:6: warning: symbol 'send_ack' was not declared. Should it be static? cmd_load.c:600:6: warning: symbol 'send_nack' was not declared. Should it be static? cmd_load.c:614:6: warning: symbol 'os_data_init' was not declared. Should it be static? cmd_load.c:615:6: warning: symbol 'os_data_char' was not declared. Should it be static? cmd_load.c:657:6: warning: symbol 'k_data_init' was not declared. Should it be static? cmd_load.c:663:6: warning: symbol 'k_data_save' was not declared. Should it be static? cmd_load.c:669:6: warning: symbol 'k_data_restore' was not declared. Should it be static? cmd_load.c:675:6: warning: symbol 'k_data_char' was not declared. Should it be static? cmd_load.c:693:6: warning: symbol 'send_parms' was not declared. Should it be static? cmd_load.c:694:6: warning: symbol 'send_ptr' was not declared. Should it be static? cmd_load.c:698:6: warning: symbol 'handle_send_packet' was not declared. Should i cmd_mdio.c:60:5: warning: symbol 'mdio_write_ranges' was not declared. Should it be static? cmd_mdio.c:82:5: warning: symbol 'mdio_read_ranges' was not declared. Should it be static? cmd_mdio.c:115:5: warning: symbol 'extract_reg_range' was not declared. Should it be static? cmd_mdio.c:144:5: warning: symbol 'extract_phy_range' was not declared. Should it cmd_mem.c:54:5: warning: symbol 'do_mem_md' was not declared. Should it be static? cmd_mem.c:150:5: warning: symbol 'do_mem_mm' was not declared. Should it be static? cmd_mem.c:154:5: warning: symbol 'do_mem_nm' was not declared. Should it be static? cmd_mem.c:159:5: warning: symbol 'do_mem_mw' was not declared. Should it be static? cmd_mem.c:256:5: warning: symbol 'do_mem_cmp' was not declared. Should it be static? cmd_mem.c:326:5: warning: symbol 'do_mem_cp' was not declared. Should it be static? cmd_mem.c:436:5: warning: symbol 'do_mem_base' was not declared. Should it be static? cmd_mem.c:449:5: warning: symbol 'do_mem_loop' was not declared. Should it be static? cmd_mem.c:595:5: warning: symbol 'do_mem_mtest' was not declared. Should it be static? cmd_mem.c:618:26: warning: Using plain integer as NULL pointer cmd_mem.c:1057:5: warning: symbol 'do_mem_crc' was not declared. Should it be static? cmd_misc.c:30:5: warning: symbol 'do_sleep' was not declared. Should it be static cmd_mmc.c:118:5: warning: symbol 'do_mmcinfo' was not declared. Should it be static? cmd_mmc.c:272:32: warning: Using plain integer as NULL pointer cmd_mmc.c:150:5: warning: symbol 'do_mmcops' was not declared. Should it be stati cmd_mp.c:27:1: warning: symbol 'cpu_cmd' was not declared. Should it be static? cmd_mp.c:85:1: error: directive in argument list cmd_mp.c:88:1: error: directive in argument list cmd_mtdparts.c:150:18: warning: symbol 'mtdids' was not declared. Should it be static? cmd_mtdparts.c:153:18: warning: symbol 'devices' was not declared. Should it be static? cmd_mtdparts.c:713:5: warning: symbol 'mtd_device_validate' was not declared. Should it be static? cmd_mtdparts.c:1887:5: warning: symbol 'do_chpart' was not declared. Should it be static? cmd_mtdparts.c:1925:5: warning: symbol 'do_mtdparts' was not declared. Should it be static? cmd_mtdparts.c:2060:1: error: directive in argument list cmd_mtdparts.c:2063:1: error: directive in argument list cmd_mtdparts.c:2066:1: error: directive in argument list cmd_mtdparts.c:2071:1: error: directive in argument list cmd_mtdparts.c:2073:1: error: directive in argument list cmd_nand.c:377:18: error: bad constant expression cmd_nand.c:431:5: warning: symbol 'do_nand' was not declared. Should it be static? cmd_nand.c:796:1: error: directive in argument list cmd_nand.c:801:1: error: directive in argument list cmd_nand.c:802:1: error: directive in argument list cmd_nand.c:806:1: error: directive in argument list cmd_nand.c:819:1: error: directive in argument list cmd_nand.c:824:1: error: directive in argument list cmd_nand.c:825:1: error: directive in argument list cmd_nand.c:831:1: error: directive in argument list cmd_nand.c:918:5: warning: symbol 'do_nandboot' was not declared. Should it be static? cmd_net.c:33:5: warning: symbol 'do_bootp' was not declared. Should it be static? cmd_net.c:107:5: warning: symbol 'do_dhcp' was not declared. Should it be static? cmd_net.c:120:5: warning: symbol 'do_nfs' was not declared. Should it be static? cmd_nvedit.c:138:5: warning: symbol 'do_env_print' was not declared. Should it be static? cmd_nvedit.c:323:5: warning: symbol '_do_env_set' was not declared. Should it be static? cmd_nvedit.c:435:5: warning: symbol 'do_env_set' was not declared. Should it be static? cmd_nvedit.c:514:5: warning: symbol 'do_env_edit' was not declared. Should it be static? cmd_nvedit.c:620:5: warning: symbol 'do_env_save' was not declared. Should it be static? cmd_nvedit.c:1016:1: error: directive in argument list cmd_nvedit.c:1018:1: error: directive in argument list cmd_nvedit.c:1021:1: error: directive in argument list cmd_nvedit.c:1023:1: error: directive in argument list cmd_nvedit.c:1024:1: error: directive in argument list cmd_nvedit.c:1026:1: error: directive in argument list cmd_nvedit.c:1027:1: error: directive in argument list cmd_nvedit.c:1029:1: error: directive in argument list cmd_nvedit.c:1030:1: error: directive in argument list cmd_nvedit.c:1032:1: error: directive in argument list cmd_nvedit.c:1034:1: error: directive in argument list cmd_nvedit.c:1036:1: error: directive in argument list cmd_nvedit.c:1037:1: error: directive in argument list cmd_nvedit.c:1039:1: error: directive in argument list cmd_pci.c:38:17: warning: symbol 'ShortPCIListing' was not declared. Should it be static? cmd_pci.c:38:22: warning: 'ShortPCIListing' defined but not used [-Wunused-variable] cmd_pci.c:411:5: warning: symbol 'do_pci' was not declared. Should it be static? cmd_pci.c:494:1: error: directive in argument list cmd_pci.c:497:1: error: directive in argument list cmd_reginfo.c:40:5: warning: symbol 'do_reginfo' was not declared. Should it be static? cmd_sata.c:31:5: warning: symbol 'sata_curr_device' was not declared. Should it be static? note -> ata_piix.c doesn't seem to use 'sata_curr_device'; deleted. cmd_sata.c:32:18: warning: symbol 'sata_dev_desc' was not declared. Should it be static? cmd_sata.c:70:5: warning: symbol 'do_sata' was not declared. Should it be static? cmd_setexpr.c:53:5: warning: symbol 'do_setexpr' was not declared. Should it be static? cmd_source.c:186:1: error: directive in argument list cmd_source.c:190:1: error: directive in argument list cmd_test.c:27:5: warning: symbol 'do_test' was not declared. Should it be static? cmd_test.c:153:5: warning: symbol 'do_false' was not declared. Should it be static? cmd_test.c:164:5: warning: symbol 'do_true' was not declared. Should it be static cmd_usb.c:43:6: warning: symbol 'usb_get_class_desc' was not declared. Should it be static? cmd_usb.c:69:6: warning: symbol 'usb_display_class_sub' was not declared. Should it be static? cmd_usb.c:151:6: warning: symbol 'usb_display_string' was not declared. Should it be static? cmd_usb.c:161:6: warning: symbol 'usb_display_desc' was not declared. Should it be static? cmd_usb.c:195:6: warning: symbol 'usb_display_conf_desc' was not declared. Should it be static? cmd_usb.c:210:6: warning: symbol 'usb_display_if_desc' was not declared. Should it be static? cmd_usb.c:227:6: warning: symbol 'usb_display_ep_desc' was not declared. Should it be static? cmd_usb.c:252:6: warning: symbol 'usb_display_config' was not declared. Should it be static? cmd_usb.c:283:6: warning: symbol 'usb_show_tree_graph' was not declared. Should it be static? cmd_usb.c:343:6: warning: symbol 'usb_show_tree' was not declared. Should it be static? cmd_usb.c:356:5: warning: symbol 'do_usbboot' was not declared. Should it be static? cmd_usb.c:366:5: warning: symbol 'do_usb' was not declared. Should it be static? cmd_version.c:31:5: warning: symbol 'do_version' was not declared. Should it be s cmd_ximg.c:46:1: warning: symbol 'do_imgextract' was not declared. Should it be static? cmd_ximg.c:272:1: error: directive in argument list cmd_ximg.c:276:1: error: directive in argument list Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Showing 32 changed files with 387 additions and 334 deletions Side-by-side Diff
- common/cmd_boot.c
- common/cmd_bootm.c
- common/cmd_console.c
- common/cmd_date.c
- common/cmd_echo.c
- common/cmd_exit.c
- common/cmd_fat.c
- common/cmd_fdt.c
- common/cmd_flash.c
- common/cmd_help.c
- common/cmd_i2c.c
- common/cmd_irq.c
- common/cmd_itest.c
- common/cmd_load.c
- common/cmd_mdio.c
- common/cmd_mem.c
- common/cmd_misc.c
- common/cmd_mmc.c
- common/cmd_mp.c
- common/cmd_mtdparts.c
- common/cmd_nand.c
- common/cmd_net.c
- common/cmd_nvedit.c
- common/cmd_pci.c
- common/cmd_reginfo.c
- common/cmd_sata.c
- common/cmd_setexpr.c
- common/cmd_source.c
- common/cmd_test.c
- common/cmd_usb.c
- common/cmd_version.c
- common/cmd_ximg.c
common/cmd_boot.c
... | ... | @@ -32,12 +32,13 @@ |
32 | 32 | |
33 | 33 | /* Allow ports to override the default behavior */ |
34 | 34 | __attribute__((weak)) |
35 | -unsigned long do_go_exec (ulong (*entry)(int, char * const []), int argc, char * const argv[]) | |
35 | +unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, | |
36 | + char * const argv[]) | |
36 | 37 | { |
37 | 38 | return entry (argc, argv); |
38 | 39 | } |
39 | 40 | |
40 | -int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
41 | +static int do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
41 | 42 | { |
42 | 43 | ulong addr, rc; |
43 | 44 | int rcode = 0; |
common/cmd_bootm.c
... | ... | @@ -161,7 +161,7 @@ |
161 | 161 | bootm_headers_t images; /* pointers to os/initrd/fdt images */ |
162 | 162 | |
163 | 163 | /* Allow for arch specific config before we boot */ |
164 | -void __arch_preboot_os(void) | |
164 | +static void __arch_preboot_os(void) | |
165 | 165 | { |
166 | 166 | /* please define platform specific arch_preboot_os() */ |
167 | 167 | } |
... | ... | @@ -474,7 +474,7 @@ |
474 | 474 | U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""), |
475 | 475 | }; |
476 | 476 | |
477 | -int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, | |
477 | +static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc, | |
478 | 478 | char * const argv[]) |
479 | 479 | { |
480 | 480 | int ret = 0; |
... | ... | @@ -1013,9 +1013,8 @@ |
1013 | 1013 | return (void *)img_addr; |
1014 | 1014 | } |
1015 | 1015 | |
1016 | -U_BOOT_CMD( | |
1017 | - bootm, CONFIG_SYS_MAXARGS, 1, do_bootm, | |
1018 | - "boot application image from memory", | |
1016 | +#ifdef CONFIG_SYS_LONGHELP | |
1017 | +static char bootm_help_text[] = | |
1019 | 1018 | "[addr [arg ...]]\n - boot application image stored in memory\n" |
1020 | 1019 | "\tpassing arguments 'arg ...'; when booting a Linux kernel,\n" |
1021 | 1020 | "\t'arg' can be the address of an initrd image\n" |
... | ... | @@ -1048,7 +1047,12 @@ |
1048 | 1047 | "\tcmdline - OS specific command line processing/setup\n" |
1049 | 1048 | "\tbdt - OS specific bd_t processing\n" |
1050 | 1049 | "\tprep - OS specific prep before relocation or go\n" |
1051 | - "\tgo - start OS" | |
1050 | + "\tgo - start OS"; | |
1051 | +#endif | |
1052 | + | |
1053 | +U_BOOT_CMD( | |
1054 | + bootm, CONFIG_SYS_MAXARGS, 1, do_bootm, | |
1055 | + "boot application image from memory", bootm_help_text | |
1052 | 1056 | ); |
1053 | 1057 | |
1054 | 1058 | /*******************************************************************/ |
... | ... | @@ -1084,7 +1088,7 @@ |
1084 | 1088 | /* iminfo - print header info for a requested image */ |
1085 | 1089 | /*******************************************************************/ |
1086 | 1090 | #if defined(CONFIG_CMD_IMI) |
1087 | -int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1091 | +static int do_iminfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1088 | 1092 | { |
1089 | 1093 | int arg; |
1090 | 1094 | ulong addr; |
... | ... | @@ -1171,7 +1175,7 @@ |
1171 | 1175 | /* imls - list all images found in flash */ |
1172 | 1176 | /*******************************************************************/ |
1173 | 1177 | #if defined(CONFIG_CMD_IMLS) |
1174 | -int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1178 | +static int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1175 | 1179 | { |
1176 | 1180 | flash_info_t *info; |
1177 | 1181 | int i, j; |
... | ... | @@ -1643,9 +1647,8 @@ |
1643 | 1647 | return 1; |
1644 | 1648 | } |
1645 | 1649 | |
1646 | -U_BOOT_CMD( | |
1647 | - bootz, CONFIG_SYS_MAXARGS, 1, do_bootz, | |
1648 | - "boot Linux zImage image from memory", | |
1650 | +#ifdef CONFIG_SYS_LONGHELP | |
1651 | +static char bootz_help_text[] = | |
1649 | 1652 | "[addr [initrd[:size]] [fdt]]\n" |
1650 | 1653 | " - boot Linux zImage stored in memory\n" |
1651 | 1654 | "\tThe argument 'initrd' is optional and specifies the address\n" |
... | ... | @@ -1658,6 +1661,12 @@ |
1658 | 1661 | "\tuse a '-' for the second argument. If you do not pass a third\n" |
1659 | 1662 | "\ta bd_info struct will be passed instead\n" |
1660 | 1663 | #endif |
1664 | + ""; | |
1665 | +#endif | |
1666 | + | |
1667 | +U_BOOT_CMD( | |
1668 | + bootz, CONFIG_SYS_MAXARGS, 1, do_bootz, | |
1669 | + "boot Linux zImage image from memory", bootz_help_text | |
1661 | 1670 | ); |
1662 | 1671 | #endif /* CONFIG_CMD_BOOTZ */ |
common/cmd_console.c
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | #include <stdio_dev.h> |
30 | 30 | |
31 | 31 | extern void _do_coninfo (void); |
32 | -int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * const argv[]) | |
32 | +static int do_coninfo(cmd_tbl_t *cmd, int flag, int argc, char * const argv[]) | |
33 | 33 | { |
34 | 34 | int l; |
35 | 35 | struct list_head *list = stdio_get_list(); |
common/cmd_date.c
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | |
44 | 44 | int mk_date (const char *, struct rtc_time *); |
45 | 45 | |
46 | -int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
46 | +static int do_date(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
47 | 47 | { |
48 | 48 | struct rtc_time tm; |
49 | 49 | int rcode = 0; |
common/cmd_echo.c
common/cmd_exit.c
common/cmd_fat.c
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | " All numeric parameters are assumed to be hex." |
53 | 53 | ); |
54 | 54 | |
55 | -int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
55 | +static int do_fat_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
56 | 56 | { |
57 | 57 | return do_ls(cmdtp, flag, argc, argv, FS_TYPE_FAT); |
58 | 58 | } |
... | ... | @@ -64,7 +64,8 @@ |
64 | 64 | " - list files from 'dev' on 'interface' in a 'directory'" |
65 | 65 | ); |
66 | 66 | |
67 | -int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
67 | +static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, | |
68 | + char * const argv[]) | |
68 | 69 | { |
69 | 70 | int dev, part; |
70 | 71 | block_dev_desc_t *dev_desc; |
common/cmd_fdt.c
... | ... | @@ -95,7 +95,7 @@ |
95 | 95 | /* |
96 | 96 | * Flattened Device Tree command, see the help for parameter definitions. |
97 | 97 | */ |
98 | -int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) | |
98 | +static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
99 | 99 | { |
100 | 100 | if (argc < 2) |
101 | 101 | return CMD_RET_USAGE; |
... | ... | @@ -682,7 +682,7 @@ |
682 | 682 | |
683 | 683 | cp = newp; |
684 | 684 | tmp = simple_strtoul(cp, &newp, 0); |
685 | - *(uint32_t *)data = __cpu_to_be32(tmp); | |
685 | + *(__be32 *)data = __cpu_to_be32(tmp); | |
686 | 686 | data += 4; |
687 | 687 | *len += 4; |
688 | 688 | |
... | ... | @@ -818,7 +818,7 @@ |
818 | 818 | if (len > CONFIG_CMD_FDT_MAX_DUMP) |
819 | 819 | printf("* 0x%p [0x%08x]", data, len); |
820 | 820 | else { |
821 | - const u32 *p; | |
821 | + const __be32 *p; | |
822 | 822 | |
823 | 823 | printf("<"); |
824 | 824 | for (j = 0, p = data; j < len/4; j++) |
... | ... | @@ -964,11 +964,9 @@ |
964 | 964 | } |
965 | 965 | |
966 | 966 | /********************************************************************/ |
967 | - | |
968 | -U_BOOT_CMD( | |
969 | - fdt, 255, 0, do_fdt, | |
970 | - "flattened device tree utility commands", | |
971 | - "addr <addr> [<length>] - Set the fdt location to <addr>\n" | |
967 | +#ifdef CONFIG_SYS_LONGHELP | |
968 | +static char fdt_help_text[] = | |
969 | + "addr <addr> [<length>] - Set the fdt location to <addr>\n" | |
972 | 970 | #ifdef CONFIG_OF_BOARD_SETUP |
973 | 971 | "fdt boardsetup - Do board-specific set up\n" |
974 | 972 | #endif |
... | ... | @@ -992,6 +990,11 @@ |
992 | 990 | "fdt chosen [<start> <end>] - Add/update the /chosen branch in the tree\n" |
993 | 991 | " <start>/<end> - initrd start/end addr\n" |
994 | 992 | "NOTE: Dereference aliases by omiting the leading '/', " |
995 | - "e.g. fdt print ethernet0." | |
993 | + "e.g. fdt print ethernet0."; | |
994 | +#endif | |
995 | + | |
996 | +U_BOOT_CMD( | |
997 | + fdt, 255, 0, do_fdt, | |
998 | + "flattened device tree utility commands", fdt_help_text | |
996 | 999 | ); |
common/cmd_flash.c
... | ... | @@ -289,7 +289,7 @@ |
289 | 289 | } |
290 | 290 | #endif /* CONFIG_SYS_NO_FLASH */ |
291 | 291 | |
292 | -int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
292 | +static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
293 | 293 | { |
294 | 294 | #ifndef CONFIG_SYS_NO_FLASH |
295 | 295 | ulong bank; |
... | ... | @@ -321,7 +321,7 @@ |
321 | 321 | return 0; |
322 | 322 | } |
323 | 323 | |
324 | -int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
324 | +static int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
325 | 325 | { |
326 | 326 | #ifndef CONFIG_SYS_NO_FLASH |
327 | 327 | flash_info_t *info = NULL; |
... | ... | @@ -454,7 +454,7 @@ |
454 | 454 | } |
455 | 455 | #endif /* CONFIG_SYS_NO_FLASH */ |
456 | 456 | |
457 | -int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
457 | +static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
458 | 458 | { |
459 | 459 | int rcode = 0; |
460 | 460 | #ifndef CONFIG_SYS_NO_FLASH |
common/cmd_help.c
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | #include <common.h> |
25 | 25 | #include <command.h> |
26 | 26 | |
27 | -int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) | |
27 | +static int do_help(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
28 | 28 | { |
29 | 29 | cmd_tbl_t *start = ll_entry_start(cmd_tbl_t, cmd); |
30 | 30 | const int len = ll_entry_count(cmd_tbl_t, cmd); |
common/cmd_i2c.c
... | ... | @@ -133,7 +133,7 @@ |
133 | 133 | #define DISP_LINE_LEN 16 |
134 | 134 | |
135 | 135 | /* implement possible board specific board init */ |
136 | -void __def_i2c_init_board(void) | |
136 | +static void __def_i2c_init_board(void) | |
137 | 137 | { |
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
... | ... | @@ -141,14 +141,14 @@ |
141 | 141 | __attribute__((weak, alias("__def_i2c_init_board"))); |
142 | 142 | |
143 | 143 | /* TODO: Implement architecture-specific get/set functions */ |
144 | -unsigned int __def_i2c_get_bus_speed(void) | |
144 | +static unsigned int __def_i2c_get_bus_speed(void) | |
145 | 145 | { |
146 | 146 | return CONFIG_SYS_I2C_SPEED; |
147 | 147 | } |
148 | 148 | unsigned int i2c_get_bus_speed(void) |
149 | 149 | __attribute__((weak, alias("__def_i2c_get_bus_speed"))); |
150 | 150 | |
151 | -int __def_i2c_set_bus_speed(unsigned int speed) | |
151 | +static int __def_i2c_set_bus_speed(unsigned int speed) | |
152 | 152 | { |
153 | 153 | if (speed != CONFIG_SYS_I2C_SPEED) |
154 | 154 | return -1; |
... | ... | @@ -1376,10 +1376,8 @@ |
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | /***************************************************/ |
1379 | - | |
1380 | -U_BOOT_CMD( | |
1381 | - i2c, 6, 1, do_i2c, | |
1382 | - "I2C sub-system", | |
1379 | +#ifdef CONFIG_SYS_LONGHELP | |
1380 | +static char i2c_help_text[] = | |
1383 | 1381 | #if defined(CONFIG_I2C_MUX) |
1384 | 1382 | "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over muxes\ni2c " |
1385 | 1383 | #endif /* CONFIG_I2C_MUX */ |
... | ... | @@ -1399,7 +1397,13 @@ |
1399 | 1397 | #if defined(CONFIG_CMD_SDRAM) |
1400 | 1398 | "i2c sdram chip - print SDRAM configuration information\n" |
1401 | 1399 | #endif |
1402 | - "i2c speed [speed] - show or set I2C bus speed" | |
1400 | + "i2c speed [speed] - show or set I2C bus speed"; | |
1401 | +#endif | |
1402 | + | |
1403 | +U_BOOT_CMD( | |
1404 | + i2c, 6, 1, do_i2c, | |
1405 | + "I2C sub-system", | |
1406 | + i2c_help_text | |
1403 | 1407 | ); |
1404 | 1408 | |
1405 | 1409 | #if defined(CONFIG_I2C_MUX) |
common/cmd_irq.c
common/cmd_itest.c
... | ... | @@ -130,7 +130,7 @@ |
130 | 130 | return (0); |
131 | 131 | } |
132 | 132 | |
133 | -int binary_test (char *op, char *arg1, char *arg2, int w) | |
133 | +static int binary_test(char *op, char *arg1, char *arg2, int w) | |
134 | 134 | { |
135 | 135 | int len, i; |
136 | 136 | const op_tbl_t *optp; |
... | ... | @@ -155,7 +155,7 @@ |
155 | 155 | } |
156 | 156 | |
157 | 157 | /* command line interface to the shell test */ |
158 | -int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] ) | |
158 | +static int do_itest(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
159 | 159 | { |
160 | 160 | int value, w; |
161 | 161 |
common/cmd_load.c
... | ... | @@ -34,15 +34,15 @@ |
34 | 34 | DECLARE_GLOBAL_DATA_PTR; |
35 | 35 | |
36 | 36 | #if defined(CONFIG_CMD_LOADB) |
37 | -static ulong load_serial_ymodem (ulong offset); | |
37 | +static ulong load_serial_ymodem(ulong offset); | |
38 | 38 | #endif |
39 | 39 | |
40 | 40 | #if defined(CONFIG_CMD_LOADS) |
41 | -static ulong load_serial (long offset); | |
42 | -static int read_record (char *buf, ulong len); | |
41 | +static ulong load_serial(long offset); | |
42 | +static int read_record(char *buf, ulong len); | |
43 | 43 | # if defined(CONFIG_CMD_SAVES) |
44 | -static int save_serial (ulong offset, ulong size); | |
45 | -static int write_record (char *buf); | |
44 | +static int save_serial(ulong offset, ulong size); | |
45 | +static int write_record(char *buf); | |
46 | 46 | #endif |
47 | 47 | |
48 | 48 | static int do_echo = 1; |
... | ... | @@ -51,7 +51,8 @@ |
51 | 51 | /* -------------------------------------------------------------------- */ |
52 | 52 | |
53 | 53 | #if defined(CONFIG_CMD_LOADS) |
54 | -int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
54 | +static int do_load_serial(cmd_tbl_t *cmdtp, int flag, int argc, | |
55 | + char * const argv[]) | |
55 | 56 | { |
56 | 57 | long offset = 0; |
57 | 58 | ulong addr; |
58 | 59 | |
... | ... | @@ -82,11 +83,11 @@ |
82 | 83 | load_baudrate = current_baudrate; |
83 | 84 | } |
84 | 85 | if (load_baudrate != current_baudrate) { |
85 | - printf ("## Switch baudrate to %d bps and press ENTER ...\n", | |
86 | + printf("## Switch baudrate to %d bps and press ENTER ...\n", | |
86 | 87 | load_baudrate); |
87 | 88 | udelay(50000); |
88 | 89 | gd->baudrate = load_baudrate; |
89 | - serial_setbrg (); | |
90 | + serial_setbrg(); | |
90 | 91 | udelay(50000); |
91 | 92 | for (;;) { |
92 | 93 | if (getc() == '\r') |
93 | 94 | |
... | ... | @@ -99,9 +100,9 @@ |
99 | 100 | } |
100 | 101 | #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */ |
101 | 102 | |
102 | - printf ("## Ready for S-Record download ...\n"); | |
103 | + printf("## Ready for S-Record download ...\n"); | |
103 | 104 | |
104 | - addr = load_serial (offset); | |
105 | + addr = load_serial(offset); | |
105 | 106 | |
106 | 107 | /* |
107 | 108 | * Gather any trailing characters (for instance, the ^D which |
108 | 109 | |
109 | 110 | |
110 | 111 | |
111 | 112 | |
... | ... | @@ -116,21 +117,21 @@ |
116 | 117 | } |
117 | 118 | |
118 | 119 | if (addr == ~0) { |
119 | - printf ("## S-Record download aborted\n"); | |
120 | + printf("## S-Record download aborted\n"); | |
120 | 121 | rcode = 1; |
121 | 122 | } else { |
122 | - printf ("## Start Addr = 0x%08lX\n", addr); | |
123 | + printf("## Start Addr = 0x%08lX\n", addr); | |
123 | 124 | load_addr = addr; |
124 | 125 | } |
125 | 126 | |
126 | 127 | #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE |
127 | 128 | if (load_baudrate != current_baudrate) { |
128 | - printf ("## Switch baudrate to %d bps and press ESC ...\n", | |
129 | + printf("## Switch baudrate to %d bps and press ESC ...\n", | |
129 | 130 | current_baudrate); |
130 | - udelay (50000); | |
131 | + udelay(50000); | |
131 | 132 | gd->baudrate = current_baudrate; |
132 | - serial_setbrg (); | |
133 | - udelay (50000); | |
133 | + serial_setbrg(); | |
134 | + udelay(50000); | |
134 | 135 | for (;;) { |
135 | 136 | if (getc() == 0x1B) /* ESC */ |
136 | 137 | break; |
... | ... | @@ -140,8 +141,7 @@ |
140 | 141 | return rcode; |
141 | 142 | } |
142 | 143 | |
143 | -static ulong | |
144 | -load_serial (long offset) | |
144 | +static ulong load_serial(long offset) | |
145 | 145 | { |
146 | 146 | char record[SREC_MAXRECLEN + 1]; /* buffer for one S-Record */ |
147 | 147 | char binbuf[SREC_MAXBINLEN]; /* buffer for binary data */ |
... | ... | @@ -156,7 +156,7 @@ |
156 | 156 | int line_count = 0; |
157 | 157 | |
158 | 158 | while (read_record(record, SREC_MAXRECLEN + 1) >= 0) { |
159 | - type = srec_decode (record, &binlen, &addr, binbuf); | |
159 | + type = srec_decode(record, &binlen, &addr, binbuf); | |
160 | 160 | |
161 | 161 | if (type < 0) { |
162 | 162 | return (~0); /* Invalid S-Record */ |
163 | 163 | |
... | ... | @@ -173,13 +173,13 @@ |
173 | 173 | |
174 | 174 | rc = flash_write((char *)binbuf,store_addr,binlen); |
175 | 175 | if (rc != 0) { |
176 | - flash_perror (rc); | |
176 | + flash_perror(rc); | |
177 | 177 | return (~0); |
178 | 178 | } |
179 | 179 | } else |
180 | 180 | #endif |
181 | 181 | { |
182 | - memcpy ((char *)(store_addr), binbuf, binlen); | |
182 | + memcpy((char *)(store_addr), binbuf, binlen); | |
183 | 183 | } |
184 | 184 | if ((store_addr) < start_addr) |
185 | 185 | start_addr = store_addr; |
186 | 186 | |
187 | 187 | |
... | ... | @@ -189,15 +189,15 @@ |
189 | 189 | case SREC_END2: |
190 | 190 | case SREC_END3: |
191 | 191 | case SREC_END4: |
192 | - udelay (10000); | |
192 | + udelay(10000); | |
193 | 193 | size = end_addr - start_addr + 1; |
194 | - printf ("\n" | |
194 | + printf("\n" | |
195 | 195 | "## First Load Addr = 0x%08lX\n" |
196 | 196 | "## Last Load Addr = 0x%08lX\n" |
197 | 197 | "## Total Size = 0x%08lX = %ld Bytes\n", |
198 | 198 | start_addr, end_addr, size, size |
199 | 199 | ); |
200 | - flush_cache (start_addr, size); | |
200 | + flush_cache(start_addr, size); | |
201 | 201 | sprintf(buf, "%lX", size); |
202 | 202 | setenv("filesize", buf); |
203 | 203 | return (addr); |
204 | 204 | |
... | ... | @@ -208,15 +208,14 @@ |
208 | 208 | } |
209 | 209 | if (!do_echo) { /* print a '.' every 100 lines */ |
210 | 210 | if ((++line_count % 100) == 0) |
211 | - putc ('.'); | |
211 | + putc('.'); | |
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | 215 | return (~0); /* Download aborted */ |
216 | 216 | } |
217 | 217 | |
218 | -static int | |
219 | -read_record (char *buf, ulong len) | |
218 | +static int read_record(char *buf, ulong len) | |
220 | 219 | { |
221 | 220 | char *p; |
222 | 221 | char c; |
... | ... | @@ -226,7 +225,7 @@ |
226 | 225 | for (p=buf; p < buf+len; ++p) { |
227 | 226 | c = getc(); /* read character */ |
228 | 227 | if (do_echo) |
229 | - putc (c); /* ... and echo it */ | |
228 | + putc(c); /* ... and echo it */ | |
230 | 229 | |
231 | 230 | switch (c) { |
232 | 231 | case '\r': |
233 | 232 | |
... | ... | @@ -280,11 +279,11 @@ |
280 | 279 | save_baudrate = current_baudrate; |
281 | 280 | } |
282 | 281 | if (save_baudrate != current_baudrate) { |
283 | - printf ("## Switch baudrate to %d bps and press ENTER ...\n", | |
282 | + printf("## Switch baudrate to %d bps and press ENTER ...\n", | |
284 | 283 | save_baudrate); |
285 | 284 | udelay(50000); |
286 | 285 | gd->baudrate = save_baudrate; |
287 | - serial_setbrg (); | |
286 | + serial_setbrg(); | |
288 | 287 | udelay(50000); |
289 | 288 | for (;;) { |
290 | 289 | if (getc() == '\r') |
291 | 290 | |
292 | 291 | |
293 | 292 | |
294 | 293 | |
295 | 294 | |
... | ... | @@ -297,24 +296,24 @@ |
297 | 296 | } |
298 | 297 | #endif /* CONFIG_SYS_LOADS_BAUD_CHANGE */ |
299 | 298 | |
300 | - printf ("## Ready for S-Record upload, press ENTER to proceed ...\n"); | |
299 | + printf("## Ready for S-Record upload, press ENTER to proceed ...\n"); | |
301 | 300 | for (;;) { |
302 | 301 | if (getc() == '\r') |
303 | 302 | break; |
304 | 303 | } |
305 | - if(save_serial (offset, size)) { | |
306 | - printf ("## S-Record upload aborted\n"); | |
304 | + if (save_serial(offset, size)) { | |
305 | + printf("## S-Record upload aborted\n"); | |
307 | 306 | } else { |
308 | - printf ("## S-Record upload complete\n"); | |
307 | + printf("## S-Record upload complete\n"); | |
309 | 308 | } |
310 | 309 | #ifdef CONFIG_SYS_LOADS_BAUD_CHANGE |
311 | 310 | if (save_baudrate != current_baudrate) { |
312 | - printf ("## Switch baudrate to %d bps and press ESC ...\n", | |
311 | + printf("## Switch baudrate to %d bps and press ESC ...\n", | |
313 | 312 | (int)current_baudrate); |
314 | - udelay (50000); | |
313 | + udelay(50000); | |
315 | 314 | gd->baudrate = current_baudrate; |
316 | - serial_setbrg (); | |
317 | - udelay (50000); | |
315 | + serial_setbrg(); | |
316 | + udelay(50000); | |
318 | 317 | for (;;) { |
319 | 318 | if (getc() == 0x1B) /* ESC */ |
320 | 319 | break; |
... | ... | @@ -329,7 +328,7 @@ |
329 | 328 | #define SREC3_END "S70500000000FA\n" |
330 | 329 | #define SREC_BYTES_PER_RECORD 16 |
331 | 330 | |
332 | -static int save_serial (ulong address, ulong count) | |
331 | +static int save_serial(ulong address, ulong count) | |
333 | 332 | { |
334 | 333 | int i, c, reclen, checksum, length; |
335 | 334 | char *hex = "0123456789ABCDEF"; |
... | ... | @@ -384,8 +383,7 @@ |
384 | 383 | return(0); |
385 | 384 | } |
386 | 385 | |
387 | -static int | |
388 | -write_record (char *buf) | |
386 | +static int write_record(char *buf) | |
389 | 387 | { |
390 | 388 | char c; |
391 | 389 | |
392 | 390 | |
393 | 391 | |
... | ... | @@ -425,15 +423,16 @@ |
425 | 423 | |
426 | 424 | static void set_kerm_bin_mode(unsigned long *); |
427 | 425 | static int k_recv(void); |
428 | -static ulong load_serial_bin (ulong offset); | |
426 | +static ulong load_serial_bin(ulong offset); | |
429 | 427 | |
430 | 428 | |
431 | -char his_eol; /* character he needs at end of packet */ | |
432 | -int his_pad_count; /* number of pad chars he needs */ | |
433 | -char his_pad_char; /* pad chars he needs */ | |
434 | -char his_quote; /* quote chars he'll use */ | |
429 | +static char his_eol; /* character he needs at end of packet */ | |
430 | +static int his_pad_count; /* number of pad chars he needs */ | |
431 | +static char his_pad_char; /* pad chars he needs */ | |
432 | +static char his_quote; /* quote chars he'll use */ | |
435 | 433 | |
436 | -int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
434 | +static int do_load_serial_bin(cmd_tbl_t *cmdtp, int flag, int argc, | |
435 | + char * const argv[]) | |
437 | 436 | { |
438 | 437 | ulong offset = 0; |
439 | 438 | ulong addr; |
440 | 439 | |
... | ... | @@ -463,11 +462,11 @@ |
463 | 462 | } |
464 | 463 | |
465 | 464 | if (load_baudrate != current_baudrate) { |
466 | - printf ("## Switch baudrate to %d bps and press ENTER ...\n", | |
465 | + printf("## Switch baudrate to %d bps and press ENTER ...\n", | |
467 | 466 | load_baudrate); |
468 | 467 | udelay(50000); |
469 | 468 | gd->baudrate = load_baudrate; |
470 | - serial_setbrg (); | |
469 | + serial_setbrg(); | |
471 | 470 | udelay(50000); |
472 | 471 | for (;;) { |
473 | 472 | if (getc() == '\r') |
474 | 473 | |
475 | 474 | |
476 | 475 | |
477 | 476 | |
478 | 477 | |
479 | 478 | |
480 | 479 | |
481 | 480 | |
... | ... | @@ -476,37 +475,37 @@ |
476 | 475 | } |
477 | 476 | |
478 | 477 | if (strcmp(argv[0],"loady")==0) { |
479 | - printf ("## Ready for binary (ymodem) download " | |
478 | + printf("## Ready for binary (ymodem) download " | |
480 | 479 | "to 0x%08lX at %d bps...\n", |
481 | 480 | offset, |
482 | 481 | load_baudrate); |
483 | 482 | |
484 | - addr = load_serial_ymodem (offset); | |
483 | + addr = load_serial_ymodem(offset); | |
485 | 484 | |
486 | 485 | } else { |
487 | 486 | |
488 | - printf ("## Ready for binary (kermit) download " | |
487 | + printf("## Ready for binary (kermit) download " | |
489 | 488 | "to 0x%08lX at %d bps...\n", |
490 | 489 | offset, |
491 | 490 | load_baudrate); |
492 | - addr = load_serial_bin (offset); | |
491 | + addr = load_serial_bin(offset); | |
493 | 492 | |
494 | 493 | if (addr == ~0) { |
495 | 494 | load_addr = 0; |
496 | - printf ("## Binary (kermit) download aborted\n"); | |
495 | + printf("## Binary (kermit) download aborted\n"); | |
497 | 496 | rcode = 1; |
498 | 497 | } else { |
499 | - printf ("## Start Addr = 0x%08lX\n", addr); | |
498 | + printf("## Start Addr = 0x%08lX\n", addr); | |
500 | 499 | load_addr = addr; |
501 | 500 | } |
502 | 501 | } |
503 | 502 | if (load_baudrate != current_baudrate) { |
504 | - printf ("## Switch baudrate to %d bps and press ESC ...\n", | |
503 | + printf("## Switch baudrate to %d bps and press ESC ...\n", | |
505 | 504 | current_baudrate); |
506 | - udelay (50000); | |
505 | + udelay(50000); | |
507 | 506 | gd->baudrate = current_baudrate; |
508 | - serial_setbrg (); | |
509 | - udelay (50000); | |
507 | + serial_setbrg(); | |
508 | + udelay(50000); | |
510 | 509 | for (;;) { |
511 | 510 | if (getc() == 0x1B) /* ESC */ |
512 | 511 | break; |
513 | 512 | |
... | ... | @@ -517,13 +516,13 @@ |
517 | 516 | } |
518 | 517 | |
519 | 518 | |
520 | -static ulong load_serial_bin (ulong offset) | |
519 | +static ulong load_serial_bin(ulong offset) | |
521 | 520 | { |
522 | 521 | int size, i; |
523 | 522 | char buf[32]; |
524 | 523 | |
525 | - set_kerm_bin_mode ((ulong *) offset); | |
526 | - size = k_recv (); | |
524 | + set_kerm_bin_mode((ulong *) offset); | |
525 | + size = k_recv(); | |
527 | 526 | |
528 | 527 | /* |
529 | 528 | * Gather any trailing characters (for instance, the ^D which |
... | ... | @@ -537,7 +536,7 @@ |
537 | 536 | udelay(1000); |
538 | 537 | } |
539 | 538 | |
540 | - flush_cache (offset, size); | |
539 | + flush_cache(offset, size); | |
541 | 540 | |
542 | 541 | printf("## Total Size = 0x%08x = %d Bytes\n", size, size); |
543 | 542 | sprintf(buf, "%X", size); |
544 | 543 | |
545 | 544 | |
... | ... | @@ -546,16 +545,16 @@ |
546 | 545 | return offset; |
547 | 546 | } |
548 | 547 | |
549 | -void send_pad (void) | |
548 | +static void send_pad(void) | |
550 | 549 | { |
551 | 550 | int count = his_pad_count; |
552 | 551 | |
553 | 552 | while (count-- > 0) |
554 | - putc (his_pad_char); | |
553 | + putc(his_pad_char); | |
555 | 554 | } |
556 | 555 | |
557 | 556 | /* converts escaped kermit char to binary char */ |
558 | -char ktrans (char in) | |
557 | +static char ktrans(char in) | |
559 | 558 | { |
560 | 559 | if ((in & 0x60) == 0x40) { |
561 | 560 | return (char) (in & ~0x40); |
... | ... | @@ -565,7 +564,7 @@ |
565 | 564 | return in; |
566 | 565 | } |
567 | 566 | |
568 | -int chk1 (char *buffer) | |
567 | +static int chk1(char *buffer) | |
569 | 568 | { |
570 | 569 | int total = 0; |
571 | 570 | |
572 | 571 | |
573 | 572 | |
574 | 573 | |
575 | 574 | |
576 | 575 | |
577 | 576 | |
578 | 577 | |
579 | 578 | |
580 | 579 | |
581 | 580 | |
582 | 581 | |
583 | 582 | |
584 | 583 | |
585 | 584 | |
586 | 585 | |
... | ... | @@ -575,67 +574,67 @@ |
575 | 574 | return (int) ((total + ((total >> 6) & 0x03)) & 0x3f); |
576 | 575 | } |
577 | 576 | |
578 | -void s1_sendpacket (char *packet) | |
577 | +static void s1_sendpacket(char *packet) | |
579 | 578 | { |
580 | - send_pad (); | |
579 | + send_pad(); | |
581 | 580 | while (*packet) { |
582 | - putc (*packet++); | |
581 | + putc(*packet++); | |
583 | 582 | } |
584 | 583 | } |
585 | 584 | |
586 | 585 | static char a_b[24]; |
587 | -void send_ack (int n) | |
586 | +static void send_ack(int n) | |
588 | 587 | { |
589 | 588 | a_b[0] = START_CHAR; |
590 | - a_b[1] = tochar (3); | |
591 | - a_b[2] = tochar (n); | |
589 | + a_b[1] = tochar(3); | |
590 | + a_b[2] = tochar(n); | |
592 | 591 | a_b[3] = ACK_TYPE; |
593 | 592 | a_b[4] = '\0'; |
594 | - a_b[4] = tochar (chk1 (&a_b[1])); | |
593 | + a_b[4] = tochar(chk1(&a_b[1])); | |
595 | 594 | a_b[5] = his_eol; |
596 | 595 | a_b[6] = '\0'; |
597 | - s1_sendpacket (a_b); | |
596 | + s1_sendpacket(a_b); | |
598 | 597 | } |
599 | 598 | |
600 | -void send_nack (int n) | |
599 | +static void send_nack(int n) | |
601 | 600 | { |
602 | 601 | a_b[0] = START_CHAR; |
603 | - a_b[1] = tochar (3); | |
604 | - a_b[2] = tochar (n); | |
602 | + a_b[1] = tochar(3); | |
603 | + a_b[2] = tochar(n); | |
605 | 604 | a_b[3] = NACK_TYPE; |
606 | 605 | a_b[4] = '\0'; |
607 | - a_b[4] = tochar (chk1 (&a_b[1])); | |
606 | + a_b[4] = tochar(chk1(&a_b[1])); | |
608 | 607 | a_b[5] = his_eol; |
609 | 608 | a_b[6] = '\0'; |
610 | - s1_sendpacket (a_b); | |
609 | + s1_sendpacket(a_b); | |
611 | 610 | } |
612 | 611 | |
613 | 612 | |
614 | -void (*os_data_init) (void); | |
615 | -void (*os_data_char) (char new_char); | |
613 | +static void (*os_data_init)(void); | |
614 | +static void (*os_data_char)(char new_char); | |
616 | 615 | static int os_data_state, os_data_state_saved; |
617 | 616 | static char *os_data_addr, *os_data_addr_saved; |
618 | 617 | static char *bin_start_address; |
619 | 618 | |
620 | -static void bin_data_init (void) | |
619 | +static void bin_data_init(void) | |
621 | 620 | { |
622 | 621 | os_data_state = 0; |
623 | 622 | os_data_addr = bin_start_address; |
624 | 623 | } |
625 | 624 | |
626 | -static void os_data_save (void) | |
625 | +static void os_data_save(void) | |
627 | 626 | { |
628 | 627 | os_data_state_saved = os_data_state; |
629 | 628 | os_data_addr_saved = os_data_addr; |
630 | 629 | } |
631 | 630 | |
632 | -static void os_data_restore (void) | |
631 | +static void os_data_restore(void) | |
633 | 632 | { |
634 | 633 | os_data_state = os_data_state_saved; |
635 | 634 | os_data_addr = os_data_addr_saved; |
636 | 635 | } |
637 | 636 | |
638 | -static void bin_data_char (char new_char) | |
637 | +static void bin_data_char(char new_char) | |
639 | 638 | { |
640 | 639 | switch (os_data_state) { |
641 | 640 | case 0: /* data */ |
... | ... | @@ -644,7 +643,7 @@ |
644 | 643 | } |
645 | 644 | } |
646 | 645 | |
647 | -static void set_kerm_bin_mode (unsigned long *addr) | |
646 | +static void set_kerm_bin_mode(unsigned long *addr) | |
648 | 647 | { |
649 | 648 | bin_start_address = (char *) addr; |
650 | 649 | os_data_init = bin_data_init; |
651 | 650 | |
652 | 651 | |
653 | 652 | |
654 | 653 | |
655 | 654 | |
656 | 655 | |
657 | 656 | |
... | ... | @@ -654,29 +653,29 @@ |
654 | 653 | |
655 | 654 | /* k_data_* simply handles the kermit escape translations */ |
656 | 655 | static int k_data_escape, k_data_escape_saved; |
657 | -void k_data_init (void) | |
656 | +static void k_data_init(void) | |
658 | 657 | { |
659 | 658 | k_data_escape = 0; |
660 | - os_data_init (); | |
659 | + os_data_init(); | |
661 | 660 | } |
662 | 661 | |
663 | -void k_data_save (void) | |
662 | +static void k_data_save(void) | |
664 | 663 | { |
665 | 664 | k_data_escape_saved = k_data_escape; |
666 | - os_data_save (); | |
665 | + os_data_save(); | |
667 | 666 | } |
668 | 667 | |
669 | -void k_data_restore (void) | |
668 | +static void k_data_restore(void) | |
670 | 669 | { |
671 | 670 | k_data_escape = k_data_escape_saved; |
672 | - os_data_restore (); | |
671 | + os_data_restore(); | |
673 | 672 | } |
674 | 673 | |
675 | -void k_data_char (char new_char) | |
674 | +static void k_data_char(char new_char) | |
676 | 675 | { |
677 | 676 | if (k_data_escape) { |
678 | 677 | /* last char was escape - translate this character */ |
679 | - os_data_char (ktrans (new_char)); | |
678 | + os_data_char(ktrans(new_char)); | |
680 | 679 | k_data_escape = 0; |
681 | 680 | } else { |
682 | 681 | if (new_char == his_quote) { |
683 | 682 | |
684 | 683 | |
... | ... | @@ -684,18 +683,18 @@ |
684 | 683 | k_data_escape = 1; |
685 | 684 | } else { |
686 | 685 | /* otherwise send this char as-is */ |
687 | - os_data_char (new_char); | |
686 | + os_data_char(new_char); | |
688 | 687 | } |
689 | 688 | } |
690 | 689 | } |
691 | 690 | |
692 | 691 | #define SEND_DATA_SIZE 20 |
693 | -char send_parms[SEND_DATA_SIZE]; | |
694 | -char *send_ptr; | |
692 | +static char send_parms[SEND_DATA_SIZE]; | |
693 | +static char *send_ptr; | |
695 | 694 | |
696 | 695 | /* handle_send_packet interprits the protocol info and builds and |
697 | 696 | sends an appropriate ack for what we can do */ |
698 | -void handle_send_packet (int n) | |
697 | +static void handle_send_packet(int n) | |
699 | 698 | { |
700 | 699 | int length = 3; |
701 | 700 | int bytes; |
702 | 701 | |
703 | 702 | |
704 | 703 | |
705 | 704 | |
... | ... | @@ -715,30 +714,30 @@ |
715 | 714 | break; |
716 | 715 | /* handle MAXL - max length */ |
717 | 716 | /* ignore what he says - most I'll take (here) is 94 */ |
718 | - a_b[++length] = tochar (94); | |
717 | + a_b[++length] = tochar(94); | |
719 | 718 | if (bytes-- <= 0) |
720 | 719 | break; |
721 | 720 | /* handle TIME - time you should wait for my packets */ |
722 | 721 | /* ignore what he says - don't wait for my ack longer than 1 second */ |
723 | - a_b[++length] = tochar (1); | |
722 | + a_b[++length] = tochar(1); | |
724 | 723 | if (bytes-- <= 0) |
725 | 724 | break; |
726 | 725 | /* handle NPAD - number of pad chars I need */ |
727 | 726 | /* remember what he says - I need none */ |
728 | - his_pad_count = untochar (send_parms[2]); | |
729 | - a_b[++length] = tochar (0); | |
727 | + his_pad_count = untochar(send_parms[2]); | |
728 | + a_b[++length] = tochar(0); | |
730 | 729 | if (bytes-- <= 0) |
731 | 730 | break; |
732 | 731 | /* handle PADC - pad chars I need */ |
733 | 732 | /* remember what he says - I need none */ |
734 | - his_pad_char = ktrans (send_parms[3]); | |
733 | + his_pad_char = ktrans(send_parms[3]); | |
735 | 734 | a_b[++length] = 0x40; /* He should ignore this */ |
736 | 735 | if (bytes-- <= 0) |
737 | 736 | break; |
738 | 737 | /* handle EOL - end of line he needs */ |
739 | 738 | /* remember what he says - I need CR */ |
740 | - his_eol = untochar (send_parms[4]); | |
741 | - a_b[++length] = tochar (END_CHAR); | |
739 | + his_eol = untochar(send_parms[4]); | |
740 | + a_b[++length] = tochar(END_CHAR); | |
742 | 741 | if (bytes-- <= 0) |
743 | 742 | break; |
744 | 743 | /* handle QCTL - quote control char he'll use */ |
745 | 744 | |
746 | 745 | |
747 | 746 | |
748 | 747 | |
... | ... | @@ -764,25 +763,25 @@ |
764 | 763 | break; |
765 | 764 | /* handle CAPAS - the capabilities mask */ |
766 | 765 | /* ignore what he says - I only do long packets - I don't do windows */ |
767 | - a_b[++length] = tochar (2); /* only long packets */ | |
768 | - a_b[++length] = tochar (0); /* no windows */ | |
769 | - a_b[++length] = tochar (94); /* large packet msb */ | |
770 | - a_b[++length] = tochar (94); /* large packet lsb */ | |
766 | + a_b[++length] = tochar(2); /* only long packets */ | |
767 | + a_b[++length] = tochar(0); /* no windows */ | |
768 | + a_b[++length] = tochar(94); /* large packet msb */ | |
769 | + a_b[++length] = tochar(94); /* large packet lsb */ | |
771 | 770 | } while (0); |
772 | 771 | |
773 | 772 | a_b[0] = START_CHAR; |
774 | - a_b[1] = tochar (length); | |
775 | - a_b[2] = tochar (n); | |
773 | + a_b[1] = tochar(length); | |
774 | + a_b[2] = tochar(n); | |
776 | 775 | a_b[3] = ACK_TYPE; |
777 | 776 | a_b[++length] = '\0'; |
778 | - a_b[length] = tochar (chk1 (&a_b[1])); | |
777 | + a_b[length] = tochar(chk1(&a_b[1])); | |
779 | 778 | a_b[++length] = his_eol; |
780 | 779 | a_b[++length] = '\0'; |
781 | - s1_sendpacket (a_b); | |
780 | + s1_sendpacket(a_b); | |
782 | 781 | } |
783 | 782 | |
784 | 783 | /* k_recv receives a OS Open image file over kermit line */ |
785 | -static int k_recv (void) | |
784 | +static int k_recv(void) | |
786 | 785 | { |
787 | 786 | char new_char; |
788 | 787 | char k_state, k_state_saved; |
789 | 788 | |
... | ... | @@ -801,9 +800,9 @@ |
801 | 800 | /* initialize the k_recv and k_data state machine */ |
802 | 801 | done = 0; |
803 | 802 | k_state = 0; |
804 | - k_data_init (); | |
803 | + k_data_init(); | |
805 | 804 | k_state_saved = k_state; |
806 | - k_data_save (); | |
805 | + k_data_save(); | |
807 | 806 | n = 0; /* just to get rid of a warning */ |
808 | 807 | last_n = -1; |
809 | 808 | |
810 | 809 | |
811 | 810 | |
812 | 811 | |
... | ... | @@ -848,17 +847,17 @@ |
848 | 847 | START: |
849 | 848 | /* get length of packet */ |
850 | 849 | sum = 0; |
851 | - new_char = getc (); | |
850 | + new_char = getc(); | |
852 | 851 | if ((new_char & 0xE0) == 0) |
853 | 852 | goto packet_error; |
854 | 853 | sum += new_char & 0xff; |
855 | - length = untochar (new_char); | |
854 | + length = untochar(new_char); | |
856 | 855 | /* get sequence number */ |
857 | - new_char = getc (); | |
856 | + new_char = getc(); | |
858 | 857 | if ((new_char & 0xE0) == 0) |
859 | 858 | goto packet_error; |
860 | 859 | sum += new_char & 0xff; |
861 | - n = untochar (new_char); | |
860 | + n = untochar(new_char); | |
862 | 861 | --length; |
863 | 862 | |
864 | 863 | /* NEW CODE - check sequence numbers for retried packets */ |
865 | 864 | |
866 | 865 | |
... | ... | @@ -871,17 +870,17 @@ |
871 | 870 | if (n == last_n) { |
872 | 871 | /* same sequence number, restore the previous state */ |
873 | 872 | k_state = k_state_saved; |
874 | - k_data_restore (); | |
873 | + k_data_restore(); | |
875 | 874 | } else { |
876 | 875 | /* new sequence number, checkpoint the download */ |
877 | 876 | last_n = n; |
878 | 877 | k_state_saved = k_state; |
879 | - k_data_save (); | |
878 | + k_data_save(); | |
880 | 879 | } |
881 | 880 | /* END NEW CODE */ |
882 | 881 | |
883 | 882 | /* get packet type */ |
884 | - new_char = getc (); | |
883 | + new_char = getc(); | |
885 | 884 | if ((new_char & 0xE0) == 0) |
886 | 885 | goto packet_error; |
887 | 886 | sum += new_char & 0xff; |
888 | 887 | |
889 | 888 | |
890 | 889 | |
891 | 890 | |
892 | 891 | |
... | ... | @@ -891,29 +890,29 @@ |
891 | 890 | if (length == -2) { |
892 | 891 | /* (length byte was 0, decremented twice) */ |
893 | 892 | /* get the two length bytes */ |
894 | - new_char = getc (); | |
893 | + new_char = getc(); | |
895 | 894 | if ((new_char & 0xE0) == 0) |
896 | 895 | goto packet_error; |
897 | 896 | sum += new_char & 0xff; |
898 | - len_hi = untochar (new_char); | |
899 | - new_char = getc (); | |
897 | + len_hi = untochar(new_char); | |
898 | + new_char = getc(); | |
900 | 899 | if ((new_char & 0xE0) == 0) |
901 | 900 | goto packet_error; |
902 | 901 | sum += new_char & 0xff; |
903 | - len_lo = untochar (new_char); | |
902 | + len_lo = untochar(new_char); | |
904 | 903 | length = len_hi * 95 + len_lo; |
905 | 904 | /* check header checksum */ |
906 | - new_char = getc (); | |
905 | + new_char = getc(); | |
907 | 906 | if ((new_char & 0xE0) == 0) |
908 | 907 | goto packet_error; |
909 | - if (new_char != tochar ((sum + ((sum >> 6) & 0x03)) & 0x3f)) | |
908 | + if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f)) | |
910 | 909 | goto packet_error; |
911 | 910 | sum += new_char & 0xff; |
912 | 911 | /* --length; */ /* new length includes only data and block check to come */ |
913 | 912 | } |
914 | 913 | /* bring in rest of packet */ |
915 | 914 | while (length > 1) { |
916 | - new_char = getc (); | |
915 | + new_char = getc(); | |
917 | 916 | if ((new_char & 0xE0) == 0) |
918 | 917 | goto packet_error; |
919 | 918 | sum += new_char & 0xff; |
920 | 919 | |
921 | 920 | |
922 | 921 | |
923 | 922 | |
924 | 923 | |
925 | 924 | |
... | ... | @@ -930,26 +929,26 @@ |
930 | 929 | } |
931 | 930 | } |
932 | 931 | /* get and validate checksum character */ |
933 | - new_char = getc (); | |
932 | + new_char = getc(); | |
934 | 933 | if ((new_char & 0xE0) == 0) |
935 | 934 | goto packet_error; |
936 | - if (new_char != tochar ((sum + ((sum >> 6) & 0x03)) & 0x3f)) | |
935 | + if (new_char != tochar((sum + ((sum >> 6) & 0x03)) & 0x3f)) | |
937 | 936 | goto packet_error; |
938 | 937 | /* get END_CHAR */ |
939 | - new_char = getc (); | |
938 | + new_char = getc(); | |
940 | 939 | if (new_char != END_CHAR) { |
941 | 940 | packet_error: |
942 | 941 | /* restore state machines */ |
943 | 942 | k_state = k_state_saved; |
944 | - k_data_restore (); | |
943 | + k_data_restore(); | |
945 | 944 | /* send a negative acknowledge packet in */ |
946 | - send_nack (n); | |
945 | + send_nack(n); | |
947 | 946 | } else if (k_state == SEND_TYPE) { |
948 | 947 | /* crack the protocol parms, build an appropriate ack packet */ |
949 | - handle_send_packet (n); | |
948 | + handle_send_packet(n); | |
950 | 949 | } else { |
951 | 950 | /* send simple acknowledge packet in */ |
952 | - send_ack (n); | |
951 | + send_ack(n); | |
953 | 952 | /* quit if end of transmission */ |
954 | 953 | if (k_state == BREAK_TYPE) |
955 | 954 | done = 1; |
... | ... | @@ -963,7 +962,7 @@ |
963 | 962 | return (getc()); |
964 | 963 | return -1; |
965 | 964 | } |
966 | -static ulong load_serial_ymodem (ulong offset) | |
965 | +static ulong load_serial_ymodem(ulong offset) | |
967 | 966 | { |
968 | 967 | int size; |
969 | 968 | char buf[32]; |
970 | 969 | |
971 | 970 | |
972 | 971 | |
... | ... | @@ -976,19 +975,19 @@ |
976 | 975 | |
977 | 976 | size = 0; |
978 | 977 | info.mode = xyzModem_ymodem; |
979 | - res = xyzModem_stream_open (&info, &err); | |
978 | + res = xyzModem_stream_open(&info, &err); | |
980 | 979 | if (!res) { |
981 | 980 | |
982 | 981 | while ((res = |
983 | - xyzModem_stream_read (ymodemBuf, 1024, &err)) > 0) { | |
982 | + xyzModem_stream_read(ymodemBuf, 1024, &err)) > 0) { | |
984 | 983 | store_addr = addr + offset; |
985 | 984 | size += res; |
986 | 985 | addr += res; |
987 | 986 | #ifndef CONFIG_SYS_NO_FLASH |
988 | - if (addr2info (store_addr)) { | |
987 | + if (addr2info(store_addr)) { | |
989 | 988 | int rc; |
990 | 989 | |
991 | - rc = flash_write ((char *) ymodemBuf, | |
990 | + rc = flash_write((char *) ymodemBuf, | |
992 | 991 | store_addr, res); |
993 | 992 | if (rc != 0) { |
994 | 993 | flash_perror (rc); |
995 | 994 | |
996 | 995 | |
997 | 996 | |
998 | 997 | |
... | ... | @@ -997,24 +996,24 @@ |
997 | 996 | } else |
998 | 997 | #endif |
999 | 998 | { |
1000 | - memcpy ((char *) (store_addr), ymodemBuf, | |
999 | + memcpy((char *)(store_addr), ymodemBuf, | |
1001 | 1000 | res); |
1002 | 1001 | } |
1003 | 1002 | |
1004 | 1003 | } |
1005 | 1004 | } else { |
1006 | - printf ("%s\n", xyzModem_error (err)); | |
1005 | + printf("%s\n", xyzModem_error(err)); | |
1007 | 1006 | } |
1008 | 1007 | |
1009 | - xyzModem_stream_close (&err); | |
1010 | - xyzModem_stream_terminate (false, &getcxmodem); | |
1008 | + xyzModem_stream_close(&err); | |
1009 | + xyzModem_stream_terminate(false, &getcxmodem); | |
1011 | 1010 | |
1012 | 1011 | |
1013 | - flush_cache (offset, size); | |
1012 | + flush_cache(offset, size); | |
1014 | 1013 | |
1015 | - printf ("## Total Size = 0x%08x = %d Bytes\n", size, size); | |
1016 | - sprintf (buf, "%X", size); | |
1017 | - setenv ("filesize", buf); | |
1014 | + printf("## Total Size = 0x%08x = %d Bytes\n", size, size); | |
1015 | + sprintf(buf, "%X", size); | |
1016 | + setenv("filesize", buf); | |
1018 | 1017 | |
1019 | 1018 | return offset; |
1020 | 1019 | } |
... | ... | @@ -1091,7 +1090,7 @@ |
1091 | 1090 | /* -------------------------------------------------------------------- */ |
1092 | 1091 | |
1093 | 1092 | #if defined(CONFIG_CMD_HWFLOW) |
1094 | -int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1093 | +int do_hwflow(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1095 | 1094 | { |
1096 | 1095 | extern int hwflow_onoff(int); |
1097 | 1096 |
common/cmd_mdio.c
... | ... | @@ -57,9 +57,9 @@ |
57 | 57 | return 0; |
58 | 58 | } |
59 | 59 | |
60 | -int mdio_write_ranges(struct mii_dev *bus, int addrlo, | |
61 | - int addrhi, int devadlo, int devadhi, | |
62 | - int reglo, int reghi, unsigned short data) | |
60 | +static int mdio_write_ranges(struct mii_dev *bus, int addrlo, | |
61 | + int addrhi, int devadlo, int devadhi, | |
62 | + int reglo, int reghi, unsigned short data) | |
63 | 63 | { |
64 | 64 | int addr, devad, reg; |
65 | 65 | int err = 0; |
... | ... | @@ -79,9 +79,9 @@ |
79 | 79 | return err; |
80 | 80 | } |
81 | 81 | |
82 | -int mdio_read_ranges(struct mii_dev *bus, int addrlo, | |
83 | - int addrhi, int devadlo, int devadhi, | |
84 | - int reglo, int reghi) | |
82 | +static int mdio_read_ranges(struct mii_dev *bus, int addrlo, | |
83 | + int addrhi, int devadlo, int devadhi, | |
84 | + int reglo, int reghi) | |
85 | 85 | { |
86 | 86 | int addr, devad, reg; |
87 | 87 | |
... | ... | @@ -112,8 +112,8 @@ |
112 | 112 | } |
113 | 113 | |
114 | 114 | /* The register will be in the form [a[-b].]x[-y] */ |
115 | -int extract_reg_range(char *input, int *devadlo, int *devadhi, | |
116 | - int *reglo, int *reghi) | |
115 | +static int extract_reg_range(char *input, int *devadlo, int *devadhi, | |
116 | + int *reglo, int *reghi) | |
117 | 117 | { |
118 | 118 | char *regstr; |
119 | 119 | |
... | ... | @@ -141,8 +141,8 @@ |
141 | 141 | return extract_range(regstr, reglo, reghi); |
142 | 142 | } |
143 | 143 | |
144 | -int extract_phy_range(char *const argv[], int argc, struct mii_dev **bus, | |
145 | - int *addrlo, int *addrhi) | |
144 | +static int extract_phy_range(char *const argv[], int argc, struct mii_dev **bus, | |
145 | + int *addrlo, int *addrhi) | |
146 | 146 | { |
147 | 147 | struct phy_device *phydev; |
148 | 148 |
common/cmd_mem.c
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | * md{.b, .w, .l} {addr} {len} |
52 | 52 | */ |
53 | 53 | #define DISP_LINE_LEN 16 |
54 | -int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
54 | +static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
55 | 55 | { |
56 | 56 | ulong addr, length; |
57 | 57 | #if defined(CONFIG_HAS_DATAFLASH) |
58 | 58 | |
59 | 59 | |
... | ... | @@ -147,16 +147,16 @@ |
147 | 147 | return (rc); |
148 | 148 | } |
149 | 149 | |
150 | -int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
150 | +static int do_mem_mm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
151 | 151 | { |
152 | 152 | return mod_mem (cmdtp, 1, flag, argc, argv); |
153 | 153 | } |
154 | -int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
154 | +static int do_mem_nm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
155 | 155 | { |
156 | 156 | return mod_mem (cmdtp, 0, flag, argc, argv); |
157 | 157 | } |
158 | 158 | |
159 | -int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
159 | +static int do_mem_mw(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
160 | 160 | { |
161 | 161 | ulong addr, writeval, count; |
162 | 162 | int size; |
... | ... | @@ -253,7 +253,7 @@ |
253 | 253 | } |
254 | 254 | #endif /* CONFIG_MX_CYCLIC */ |
255 | 255 | |
256 | -int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
256 | +static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
257 | 257 | { |
258 | 258 | ulong addr1, addr2, count, ngood; |
259 | 259 | int size; |
... | ... | @@ -323,7 +323,7 @@ |
323 | 323 | return rcode; |
324 | 324 | } |
325 | 325 | |
326 | -int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
326 | +static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
327 | 327 | { |
328 | 328 | ulong addr, dest, count; |
329 | 329 | int size; |
... | ... | @@ -433,7 +433,8 @@ |
433 | 433 | return 0; |
434 | 434 | } |
435 | 435 | |
436 | -int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
436 | +static int do_mem_base(cmd_tbl_t *cmdtp, int flag, int argc, | |
437 | + char * const argv[]) | |
437 | 438 | { |
438 | 439 | if (argc > 1) { |
439 | 440 | /* Set new base address. |
... | ... | @@ -446,7 +447,8 @@ |
446 | 447 | return 0; |
447 | 448 | } |
448 | 449 | |
449 | -int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
450 | +static int do_mem_loop(cmd_tbl_t *cmdtp, int flag, int argc, | |
451 | + char * const argv[]) | |
450 | 452 | { |
451 | 453 | ulong addr, length, i; |
452 | 454 | int size; |
... | ... | @@ -592,7 +594,8 @@ |
592 | 594 | * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until |
593 | 595 | * interrupted by ctrl-c or by a failure of one of the sub-tests. |
594 | 596 | */ |
595 | -int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
597 | +static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc, | |
598 | + char * const argv[]) | |
596 | 599 | { |
597 | 600 | vu_long *addr, *start, *end; |
598 | 601 | ulong val; |
... | ... | @@ -612,7 +615,7 @@ |
612 | 615 | #if defined(CONFIG_SYS_MEMTEST_SCRATCH) |
613 | 616 | vu_long *dummy = (vu_long*)CONFIG_SYS_MEMTEST_SCRATCH; |
614 | 617 | #else |
615 | - vu_long *dummy = 0; /* yes, this is address 0x0, not NULL */ | |
618 | + vu_long *dummy = NULL; /* yes, this is address 0x0, not NULL */ | |
616 | 619 | #endif |
617 | 620 | int j; |
618 | 621 | |
... | ... | @@ -1054,7 +1057,7 @@ |
1054 | 1057 | |
1055 | 1058 | #ifndef CONFIG_CRC32_VERIFY |
1056 | 1059 | |
1057 | -int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1060 | +static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1058 | 1061 | { |
1059 | 1062 | ulong addr, length; |
1060 | 1063 | ulong crc; |
common/cmd_misc.c
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | #include <common.h> |
28 | 28 | #include <command.h> |
29 | 29 | |
30 | -int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
30 | +static int do_sleep(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
31 | 31 | { |
32 | 32 | ulong start = get_timer(0); |
33 | 33 | ulong delay; |
34 | 34 | |
... | ... | @@ -38,10 +38,10 @@ |
38 | 38 | delay = simple_strtoul(argv[1], NULL, 10) * CONFIG_SYS_HZ; |
39 | 39 | |
40 | 40 | while (get_timer(start) < delay) { |
41 | - if (ctrlc ()) | |
41 | + if (ctrlc()) | |
42 | 42 | return (-1); |
43 | 43 | |
44 | - udelay (100); | |
44 | + udelay(100); | |
45 | 45 | } |
46 | 46 | |
47 | 47 | return 0; |
common/cmd_mmc.c
... | ... | @@ -115,7 +115,7 @@ |
115 | 115 | printf("Bus Width: %d-bit\n", mmc->bus_width); |
116 | 116 | } |
117 | 117 | |
118 | -int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
118 | +static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
119 | 119 | { |
120 | 120 | struct mmc *mmc; |
121 | 121 | |
... | ... | @@ -147,7 +147,7 @@ |
147 | 147 | "- dislay info of the current MMC device" |
148 | 148 | ); |
149 | 149 | |
150 | -int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
150 | +static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
151 | 151 | { |
152 | 152 | enum mmc_state state; |
153 | 153 | |
... | ... | @@ -269,7 +269,7 @@ |
269 | 269 | addr = (void *)simple_strtoul(argv[idx], NULL, 16); |
270 | 270 | ++idx; |
271 | 271 | } else |
272 | - addr = 0; | |
272 | + addr = NULL; | |
273 | 273 | blk = simple_strtoul(argv[idx], NULL, 16); |
274 | 274 | cnt = simple_strtoul(argv[idx + 1], NULL, 16); |
275 | 275 |
common/cmd_mp.c
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | #include <common.h> |
24 | 24 | #include <command.h> |
25 | 25 | |
26 | -int | |
26 | +static int | |
27 | 27 | cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
28 | 28 | { |
29 | 29 | unsigned long cpuid; |
30 | 30 | |
... | ... | @@ -61,8 +61,14 @@ |
61 | 61 | return 0; |
62 | 62 | } |
63 | 63 | |
64 | +#ifdef CONFIG_SYS_LONGHELP | |
65 | +static char cpu_help_text[] = | |
66 | + "<num> reset - Reset cpu <num>\n" | |
67 | + "cpu <num> status - Status of cpu <num>\n" | |
68 | + "cpu <num> disable - Disable cpu <num>\n" | |
69 | + "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]" | |
64 | 70 | #ifdef CONFIG_PPC |
65 | -#define CPU_ARCH_HELP \ | |
71 | + "\n" | |
66 | 72 | " [args] : <pir> <r3> <r6>\n" \ |
67 | 73 | " pir - processor id (if writeable)\n" \ |
68 | 74 | " r3 - value for gpr 3\n" \ |
69 | 75 | |
... | ... | @@ -74,17 +80,11 @@ |
74 | 80 | " When cpu <num> is released r4 and r5 = 0.\n" \ |
75 | 81 | " r7 will contain the size of the initial mapped area" |
76 | 82 | #endif |
83 | + ""; | |
84 | +#endif | |
77 | 85 | |
78 | 86 | U_BOOT_CMD( |
79 | 87 | cpu, CONFIG_SYS_MAXARGS, 1, cpu_cmd, |
80 | - "Multiprocessor CPU boot manipulation and release", | |
81 | - "<num> reset - Reset cpu <num>\n" | |
82 | - "cpu <num> status - Status of cpu <num>\n" | |
83 | - "cpu <num> disable - Disable cpu <num>\n" | |
84 | - "cpu <num> release <addr> [args] - Release cpu <num> at <addr> with [args]" | |
85 | -#ifdef CPU_ARCH_HELP | |
86 | - "\n" | |
87 | - CPU_ARCH_HELP | |
88 | -#endif | |
88 | + "Multiprocessor CPU boot manipulation and release", cpu_help_text | |
89 | 89 | ); |
common/cmd_mtdparts.c
... | ... | @@ -147,10 +147,10 @@ |
147 | 147 | extern void jffs2_free_cache(struct part_info *part); |
148 | 148 | |
149 | 149 | /* mtdids mapping list, filled by parse_ids() */ |
150 | -struct list_head mtdids; | |
150 | +static struct list_head mtdids; | |
151 | 151 | |
152 | 152 | /* device/partition list, parse_cmdline() parses into here */ |
153 | -struct list_head devices; | |
153 | +static struct list_head devices; | |
154 | 154 | |
155 | 155 | /* current active device and partition number */ |
156 | 156 | struct mtd_device *current_mtd_dev = NULL; |
... | ... | @@ -710,7 +710,7 @@ |
710 | 710 | * @param size a pointer to the size of the mtd device (output) |
711 | 711 | * @return 0 if device is valid, 1 otherwise |
712 | 712 | */ |
713 | -int mtd_device_validate(u8 type, u8 num, u32 *size) | |
713 | +static int mtd_device_validate(u8 type, u8 num, u32 *size) | |
714 | 714 | { |
715 | 715 | struct mtd_info *mtd = NULL; |
716 | 716 | |
... | ... | @@ -1042,7 +1042,8 @@ |
1042 | 1042 | * @param dev_num parsed device number (output) |
1043 | 1043 | * @return 0 on success, 1 otherwise |
1044 | 1044 | */ |
1045 | -int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num) | |
1045 | +int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, | |
1046 | + u8 *dev_num) | |
1046 | 1047 | { |
1047 | 1048 | const char *p = id; |
1048 | 1049 | |
... | ... | @@ -1884,7 +1885,7 @@ |
1884 | 1885 | * @param argv arguments list |
1885 | 1886 | * @return 0 on success, 1 otherwise |
1886 | 1887 | */ |
1887 | -int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1888 | +static int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1888 | 1889 | { |
1889 | 1890 | /* command line only */ |
1890 | 1891 | struct mtd_device *dev; |
... | ... | @@ -1922,7 +1923,8 @@ |
1922 | 1923 | * @param argv arguments list |
1923 | 1924 | * @return 0 on success, 1 otherwise |
1924 | 1925 | */ |
1925 | -int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
1926 | +static int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, | |
1927 | + char * const argv[]) | |
1926 | 1928 | { |
1927 | 1929 | if (argc == 2) { |
1928 | 1930 | if (strcmp(argv[1], "default") == 0) { |
... | ... | @@ -2046,9 +2048,8 @@ |
2046 | 2048 | " - change active partition (e.g. part-id = nand0,1)" |
2047 | 2049 | ); |
2048 | 2050 | |
2049 | -U_BOOT_CMD( | |
2050 | - mtdparts, 6, 0, do_mtdparts, | |
2051 | - "define flash/nand partitions", | |
2051 | +#ifdef CONFIG_SYS_LONGHELP | |
2052 | +static char mtdparts_help_text[] = | |
2052 | 2053 | "\n" |
2053 | 2054 | " - list partition table\n" |
2054 | 2055 | "mtdparts delall\n" |
... | ... | @@ -2090,7 +2091,12 @@ |
2090 | 2091 | "<size> := standard linux memsize OR '-' to denote all remaining space\n" |
2091 | 2092 | "<offset> := partition start offset within the device\n" |
2092 | 2093 | "<name> := '(' NAME ')'\n" |
2093 | - "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)" | |
2094 | + "<ro-flag> := when set to 'ro' makes partition read-only (not used, passed to kernel)"; | |
2095 | +#endif | |
2096 | + | |
2097 | +U_BOOT_CMD( | |
2098 | + mtdparts, 6, 0, do_mtdparts, | |
2099 | + "define flash/nand partitions", mtdparts_help_text | |
2094 | 2100 | ); |
2095 | 2101 | /***************************************************/ |
common/cmd_nand.c
... | ... | @@ -373,8 +373,7 @@ |
373 | 373 | { |
374 | 374 | nand_info_t *nand = &nand_info[idx]; |
375 | 375 | struct nand_chip *chip = nand->priv; |
376 | - const int bufsz = 32; | |
377 | - char buf[bufsz]; | |
376 | + char buf[32]; | |
378 | 377 | |
379 | 378 | printf("Device %d: ", idx); |
380 | 379 | if (chip->numchips > 1) |
... | ... | @@ -429,7 +428,7 @@ |
429 | 428 | return ret; |
430 | 429 | } |
431 | 430 | |
432 | -int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) | |
431 | +static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
433 | 432 | { |
434 | 433 | int i, ret = 0; |
435 | 434 | ulong addr; |
... | ... | @@ -781,9 +780,8 @@ |
781 | 780 | return CMD_RET_USAGE; |
782 | 781 | } |
783 | 782 | |
784 | -U_BOOT_CMD( | |
785 | - nand, CONFIG_SYS_MAXARGS, 1, do_nand, | |
786 | - "NAND sub-system", | |
783 | +#ifdef CONFIG_SYS_LONGHELP | |
784 | +static char nand_help_text[] = | |
787 | 785 | "info - show available NAND devices\n" |
788 | 786 | "nand device [dev] - show or set current device\n" |
789 | 787 | "nand read - addr off|partition size\n" |
... | ... | @@ -829,6 +827,12 @@ |
829 | 827 | "nand env.oob set off|partition - set enviromnent offset\n" |
830 | 828 | "nand env.oob get - get environment offset" |
831 | 829 | #endif |
830 | + ""; | |
831 | +#endif | |
832 | + | |
833 | +U_BOOT_CMD( | |
834 | + nand, CONFIG_SYS_MAXARGS, 1, do_nand, | |
835 | + "NAND sub-system", nand_help_text | |
832 | 836 | ); |
833 | 837 | |
834 | 838 | static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, |
... | ... | @@ -913,7 +917,8 @@ |
913 | 917 | return bootm_maybe_autostart(cmdtp, cmd); |
914 | 918 | } |
915 | 919 | |
916 | -int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) | |
920 | +static int do_nandboot(cmd_tbl_t *cmdtp, int flag, int argc, | |
921 | + char * const argv[]) | |
917 | 922 | { |
918 | 923 | char *boot_device = NULL; |
919 | 924 | int idx; |
common/cmd_net.c
... | ... | @@ -30,9 +30,9 @@ |
30 | 30 | |
31 | 31 | static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); |
32 | 32 | |
33 | -int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
33 | +static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
34 | 34 | { |
35 | - return netboot_common (BOOTP, cmdtp, argc, argv); | |
35 | + return netboot_common(BOOTP, cmdtp, argc, argv); | |
36 | 36 | } |
37 | 37 | |
38 | 38 | U_BOOT_CMD( |
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | "[loadAddress] [[hostIPaddr:]bootfilename]" |
42 | 42 | ); |
43 | 43 | |
44 | -int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
44 | +int do_tftpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
45 | 45 | { |
46 | 46 | int ret; |
47 | 47 | |
48 | 48 | |
... | ... | @@ -91,9 +91,9 @@ |
91 | 91 | |
92 | 92 | |
93 | 93 | #ifdef CONFIG_CMD_RARP |
94 | -int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
94 | +int do_rarpb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
95 | 95 | { |
96 | - return netboot_common (RARP, cmdtp, argc, argv); | |
96 | + return netboot_common(RARP, cmdtp, argc, argv); | |
97 | 97 | } |
98 | 98 | |
99 | 99 | U_BOOT_CMD( |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | #endif |
105 | 105 | |
106 | 106 | #if defined(CONFIG_CMD_DHCP) |
107 | -int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
107 | +static int do_dhcp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
108 | 108 | { |
109 | 109 | return netboot_common(DHCP, cmdtp, argc, argv); |
110 | 110 | } |
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | #endif |
118 | 118 | |
119 | 119 | #if defined(CONFIG_CMD_NFS) |
120 | -int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
120 | +static int do_nfs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
121 | 121 | { |
122 | 122 | return netboot_common(NFS, cmdtp, argc, argv); |
123 | 123 | } |
124 | 124 | |
125 | 125 | |
126 | 126 | |
127 | 127 | |
128 | 128 | |
... | ... | @@ -129,29 +129,29 @@ |
129 | 129 | ); |
130 | 130 | #endif |
131 | 131 | |
132 | -static void netboot_update_env (void) | |
132 | +static void netboot_update_env(void) | |
133 | 133 | { |
134 | 134 | char tmp[22]; |
135 | 135 | |
136 | 136 | if (NetOurGatewayIP) { |
137 | - ip_to_string (NetOurGatewayIP, tmp); | |
138 | - setenv ("gatewayip", tmp); | |
137 | + ip_to_string(NetOurGatewayIP, tmp); | |
138 | + setenv("gatewayip", tmp); | |
139 | 139 | } |
140 | 140 | |
141 | 141 | if (NetOurSubnetMask) { |
142 | - ip_to_string (NetOurSubnetMask, tmp); | |
143 | - setenv ("netmask", tmp); | |
142 | + ip_to_string(NetOurSubnetMask, tmp); | |
143 | + setenv("netmask", tmp); | |
144 | 144 | } |
145 | 145 | |
146 | 146 | if (NetOurHostName[0]) |
147 | - setenv ("hostname", NetOurHostName); | |
147 | + setenv("hostname", NetOurHostName); | |
148 | 148 | |
149 | 149 | if (NetOurRootPath[0]) |
150 | - setenv ("rootpath", NetOurRootPath); | |
150 | + setenv("rootpath", NetOurRootPath); | |
151 | 151 | |
152 | 152 | if (NetOurIP) { |
153 | - ip_to_string (NetOurIP, tmp); | |
154 | - setenv ("ipaddr", tmp); | |
153 | + ip_to_string(NetOurIP, tmp); | |
154 | + setenv("ipaddr", tmp); | |
155 | 155 | } |
156 | 156 | #if !defined(CONFIG_BOOTP_SERVERIP) |
157 | 157 | /* |
158 | 158 | |
159 | 159 | |
160 | 160 | |
161 | 161 | |
162 | 162 | |
... | ... | @@ -159,35 +159,35 @@ |
159 | 159 | * could have set it |
160 | 160 | */ |
161 | 161 | if (NetServerIP) { |
162 | - ip_to_string (NetServerIP, tmp); | |
163 | - setenv ("serverip", tmp); | |
162 | + ip_to_string(NetServerIP, tmp); | |
163 | + setenv("serverip", tmp); | |
164 | 164 | } |
165 | 165 | #endif |
166 | 166 | if (NetOurDNSIP) { |
167 | - ip_to_string (NetOurDNSIP, tmp); | |
168 | - setenv ("dnsip", tmp); | |
167 | + ip_to_string(NetOurDNSIP, tmp); | |
168 | + setenv("dnsip", tmp); | |
169 | 169 | } |
170 | 170 | #if defined(CONFIG_BOOTP_DNS2) |
171 | 171 | if (NetOurDNS2IP) { |
172 | - ip_to_string (NetOurDNS2IP, tmp); | |
173 | - setenv ("dnsip2", tmp); | |
172 | + ip_to_string(NetOurDNS2IP, tmp); | |
173 | + setenv("dnsip2", tmp); | |
174 | 174 | } |
175 | 175 | #endif |
176 | 176 | if (NetOurNISDomain[0]) |
177 | - setenv ("domain", NetOurNISDomain); | |
177 | + setenv("domain", NetOurNISDomain); | |
178 | 178 | |
179 | 179 | #if defined(CONFIG_CMD_SNTP) \ |
180 | 180 | && defined(CONFIG_BOOTP_TIMEOFFSET) |
181 | 181 | if (NetTimeOffset) { |
182 | - sprintf (tmp, "%d", NetTimeOffset); | |
183 | - setenv ("timeoffset", tmp); | |
182 | + sprintf(tmp, "%d", NetTimeOffset); | |
183 | + setenv("timeoffset", tmp); | |
184 | 184 | } |
185 | 185 | #endif |
186 | 186 | #if defined(CONFIG_CMD_SNTP) \ |
187 | 187 | && defined(CONFIG_BOOTP_NTPSERVER) |
188 | 188 | if (NetNtpServerIP) { |
189 | - ip_to_string (NetNtpServerIP, tmp); | |
190 | - setenv ("ntpserverip", tmp); | |
189 | + ip_to_string(NetNtpServerIP, tmp); | |
190 | + setenv("ntpserverip", tmp); | |
191 | 191 | } |
192 | 192 | #endif |
193 | 193 | } |
... | ... | @@ -224,7 +224,7 @@ |
224 | 224 | break; |
225 | 225 | |
226 | 226 | case 3: load_addr = simple_strtoul(argv[1], NULL, 16); |
227 | - copy_filename (BootFile, argv[2], sizeof(BootFile)); | |
227 | + copy_filename(BootFile, argv[2], sizeof(BootFile)); | |
228 | 228 | |
229 | 229 | break; |
230 | 230 | |
... | ... | @@ -274,7 +274,7 @@ |
274 | 274 | } |
275 | 275 | |
276 | 276 | #if defined(CONFIG_CMD_PING) |
277 | -int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
277 | +static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
278 | 278 | { |
279 | 279 | if (argc < 2) |
280 | 280 | return -1; |
... | ... | @@ -322,7 +322,7 @@ |
322 | 322 | |
323 | 323 | } |
324 | 324 | |
325 | -int do_cdp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
325 | +int do_cdp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
326 | 326 | { |
327 | 327 | int r; |
328 | 328 | |
329 | 329 | |
330 | 330 | |
331 | 331 | |
332 | 332 | |
... | ... | @@ -345,27 +345,29 @@ |
345 | 345 | #endif |
346 | 346 | |
347 | 347 | #if defined(CONFIG_CMD_SNTP) |
348 | -int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
348 | +int do_sntp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
349 | 349 | { |
350 | 350 | char *toff; |
351 | 351 | |
352 | 352 | if (argc < 2) { |
353 | - NetNtpServerIP = getenv_IPaddr ("ntpserverip"); | |
353 | + NetNtpServerIP = getenv_IPaddr("ntpserverip"); | |
354 | 354 | if (NetNtpServerIP == 0) { |
355 | - printf ("ntpserverip not set\n"); | |
355 | + printf("ntpserverip not set\n"); | |
356 | 356 | return (1); |
357 | 357 | } |
358 | 358 | } else { |
359 | 359 | NetNtpServerIP = string_to_ip(argv[1]); |
360 | 360 | if (NetNtpServerIP == 0) { |
361 | - printf ("Bad NTP server IP address\n"); | |
361 | + printf("Bad NTP server IP address\n"); | |
362 | 362 | return (1); |
363 | 363 | } |
364 | 364 | } |
365 | 365 | |
366 | - toff = getenv ("timeoffset"); | |
367 | - if (toff == NULL) NetTimeOffset = 0; | |
368 | - else NetTimeOffset = simple_strtol (toff, NULL, 10); | |
366 | + toff = getenv("timeoffset"); | |
367 | + if (toff == NULL) | |
368 | + NetTimeOffset = 0; | |
369 | + else | |
370 | + NetTimeOffset = simple_strtol(toff, NULL, 10); | |
369 | 371 | |
370 | 372 | if (NetLoop(SNTP) < 0) { |
371 | 373 | printf("SNTP failed: host %pI4 not responding\n", |
common/cmd_nvedit.c
... | ... | @@ -136,7 +136,8 @@ |
136 | 136 | return 0; |
137 | 137 | } |
138 | 138 | |
139 | -int do_env_print (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
139 | +static int do_env_print(cmd_tbl_t *cmdtp, int flag, int argc, | |
140 | + char * const argv[]) | |
140 | 141 | { |
141 | 142 | int i; |
142 | 143 | int rcode = 0; |
... | ... | @@ -322,7 +323,7 @@ |
322 | 323 | * Set a new environment variable, |
323 | 324 | * or replace or delete an existing one. |
324 | 325 | */ |
325 | -int _do_env_set(int flag, int argc, char * const argv[]) | |
326 | +static int _do_env_set(int flag, int argc, char * const argv[]) | |
326 | 327 | { |
327 | 328 | int i, len; |
328 | 329 | char *name, *value, *s; |
... | ... | @@ -435,7 +436,7 @@ |
435 | 436 | } |
436 | 437 | |
437 | 438 | #ifndef CONFIG_SPL_BUILD |
438 | -int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
439 | +static int do_env_set(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
439 | 440 | { |
440 | 441 | if (argc < 2) |
441 | 442 | return CMD_RET_USAGE; |
... | ... | @@ -514,7 +515,8 @@ |
514 | 515 | * Interactively edit an environment variable |
515 | 516 | */ |
516 | 517 | #if defined(CONFIG_CMD_EDITENV) |
517 | -int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
518 | +static int do_env_edit(cmd_tbl_t *cmdtp, int flag, int argc, | |
519 | + char * const argv[]) | |
518 | 520 | { |
519 | 521 | char buffer[CONFIG_SYS_CBSIZE]; |
520 | 522 | char *init_val; |
... | ... | @@ -622,7 +624,8 @@ |
622 | 624 | |
623 | 625 | #ifndef CONFIG_SPL_BUILD |
624 | 626 | #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) |
625 | -int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
627 | +static int do_env_save(cmd_tbl_t *cmdtp, int flag, int argc, | |
628 | + char * const argv[]) | |
626 | 629 | { |
627 | 630 | printf("Saving Environment to %s...\n", env_name_spec); |
628 | 631 | |
... | ... | @@ -1020,9 +1023,8 @@ |
1020 | 1023 | return CMD_RET_USAGE; |
1021 | 1024 | } |
1022 | 1025 | |
1023 | -U_BOOT_CMD( | |
1024 | - env, CONFIG_SYS_MAXARGS, 1, do_env, | |
1025 | - "environment handling commands", | |
1026 | +#ifdef CONFIG_SYS_LONGHELP | |
1027 | +static char env_help_text[] = | |
1026 | 1028 | #if defined(CONFIG_CMD_ASKENV) |
1027 | 1029 | "ask name [message] [size] - ask for environment variable\nenv " |
1028 | 1030 | #endif |
... | ... | @@ -1047,7 +1049,12 @@ |
1047 | 1049 | #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE) |
1048 | 1050 | "env save - save environment\n" |
1049 | 1051 | #endif |
1050 | - "env set [-f] name [arg ...]\n" | |
1052 | + "env set [-f] name [arg ...]\n"; | |
1053 | +#endif | |
1054 | + | |
1055 | +U_BOOT_CMD( | |
1056 | + env, CONFIG_SYS_MAXARGS, 1, do_env, | |
1057 | + "environment handling commands", env_help_text | |
1051 | 1058 | ); |
1052 | 1059 | |
1053 | 1060 | /* |
common/cmd_pci.c
... | ... | @@ -35,8 +35,6 @@ |
35 | 35 | #include <asm/io.h> |
36 | 36 | #include <pci.h> |
37 | 37 | |
38 | -unsigned char ShortPCIListing = 1; | |
39 | - | |
40 | 38 | /* |
41 | 39 | * Follows routines for the output of infos about devices on PCI bus. |
42 | 40 | */ |
... | ... | @@ -408,7 +406,7 @@ |
408 | 406 | * pci modify[.b, .w, .l] bus.device.function [addr] |
409 | 407 | * pci write[.b, .w, .l] bus.device.function addr value |
410 | 408 | */ |
411 | -int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
409 | +static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
412 | 410 | { |
413 | 411 | ulong addr = 0, value = 0, size = 0; |
414 | 412 | pci_dev_t bdf = 0; |
... | ... | @@ -485,10 +483,8 @@ |
485 | 483 | |
486 | 484 | /***************************************************/ |
487 | 485 | |
488 | - | |
489 | -U_BOOT_CMD( | |
490 | - pci, 5, 1, do_pci, | |
491 | - "list and access PCI Configuration Space", | |
486 | +#ifdef CONFIG_SYS_LONGHELP | |
487 | +static char pci_help_text[] = | |
492 | 488 | "[bus] [long]\n" |
493 | 489 | " - short or long list of PCI devices on bus 'bus'\n" |
494 | 490 | #ifdef CONFIG_CMD_PCI_ENUM |
... | ... | @@ -504,6 +500,11 @@ |
504 | 500 | "pci modify[.b, .w, .l] b.d.f address\n" |
505 | 501 | " - modify, auto increment CFG address\n" |
506 | 502 | "pci write[.b, .w, .l] b.d.f address value\n" |
507 | - " - write to CFG address" | |
503 | + " - write to CFG address"; | |
504 | +#endif | |
505 | + | |
506 | +U_BOOT_CMD( | |
507 | + pci, 5, 1, do_pci, | |
508 | + "list and access PCI Configuration Space", pci_help_text | |
508 | 509 | ); |
common/cmd_reginfo.c
... | ... | @@ -37,7 +37,8 @@ |
37 | 37 | extern void mpc85xx_reginfo(void); |
38 | 38 | #endif |
39 | 39 | |
40 | -int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
40 | +static int do_reginfo(cmd_tbl_t *cmdtp, int flag, int argc, | |
41 | + char * const argv[]) | |
41 | 42 | { |
42 | 43 | #if defined(CONFIG_8xx) |
43 | 44 | volatile immap_t *immap = (immap_t *)CONFIG_SYS_IMMR; |
common/cmd_sata.c
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | #include <part.h> |
29 | 29 | #include <sata.h> |
30 | 30 | |
31 | -int sata_curr_device = -1; | |
31 | +static int sata_curr_device = -1; | |
32 | 32 | block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE]; |
33 | 33 | |
34 | 34 | int __sata_initialize(void) |
... | ... | @@ -67,7 +67,7 @@ |
67 | 67 | } |
68 | 68 | #endif |
69 | 69 | |
70 | -int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
70 | +static int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
71 | 71 | { |
72 | 72 | int rc = 0; |
73 | 73 |
common/cmd_setexpr.c
common/cmd_source.c
... | ... | @@ -177,9 +177,8 @@ |
177 | 177 | return rcode; |
178 | 178 | } |
179 | 179 | |
180 | -U_BOOT_CMD( | |
181 | - source, 2, 0, do_source, | |
182 | - "run script from memory", | |
180 | +#ifdef CONFIG_SYS_LONGHELP | |
181 | +static char source_help_text[] = | |
183 | 182 | "[addr]\n" |
184 | 183 | "\t- run script starting at addr\n" |
185 | 184 | "\t- A valid image header must be present" |
... | ... | @@ -188,6 +187,12 @@ |
188 | 187 | "For FIT format uImage addr must include subimage\n" |
189 | 188 | "unit name in the form of addr:<subimg_uname>" |
190 | 189 | #endif |
190 | + ""; | |
191 | +#endif | |
192 | + | |
193 | +U_BOOT_CMD( | |
194 | + source, 2, 0, do_source, | |
195 | + "run script from memory", source_help_text | |
191 | 196 | ); |
192 | 197 | #endif |
common/cmd_test.c
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | #include <common.h> |
25 | 25 | #include <command.h> |
26 | 26 | |
27 | -int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
27 | +static int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
28 | 28 | { |
29 | 29 | char * const *ap; |
30 | 30 | int left, adv, expr, last_expr, neg, last_cmp; |
... | ... | @@ -150,7 +150,7 @@ |
150 | 150 | "[args..]" |
151 | 151 | ); |
152 | 152 | |
153 | -int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
153 | +static int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
154 | 154 | { |
155 | 155 | return 1; |
156 | 156 | } |
... | ... | @@ -161,7 +161,7 @@ |
161 | 161 | NULL |
162 | 162 | ); |
163 | 163 | |
164 | -int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
164 | +static int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
165 | 165 | { |
166 | 166 | return 0; |
167 | 167 | } |
common/cmd_usb.c
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | #endif |
41 | 41 | |
42 | 42 | /* some display routines (info command) */ |
43 | -char *usb_get_class_desc(unsigned char dclass) | |
43 | +static char *usb_get_class_desc(unsigned char dclass) | |
44 | 44 | { |
45 | 45 | switch (dclass) { |
46 | 46 | case USB_CLASS_PER_INTERFACE: |
... | ... | @@ -66,8 +66,8 @@ |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | -void usb_display_class_sub(unsigned char dclass, unsigned char subclass, | |
70 | - unsigned char proto) | |
69 | +static void usb_display_class_sub(unsigned char dclass, unsigned char subclass, | |
70 | + unsigned char proto) | |
71 | 71 | { |
72 | 72 | switch (dclass) { |
73 | 73 | case USB_CLASS_PER_INTERFACE: |
... | ... | @@ -148,7 +148,7 @@ |
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | -void usb_display_string(struct usb_device *dev, int index) | |
151 | +static void usb_display_string(struct usb_device *dev, int index) | |
152 | 152 | { |
153 | 153 | ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256); |
154 | 154 | |
... | ... | @@ -158,7 +158,7 @@ |
158 | 158 | } |
159 | 159 | } |
160 | 160 | |
161 | -void usb_display_desc(struct usb_device *dev) | |
161 | +static void usb_display_desc(struct usb_device *dev) | |
162 | 162 | { |
163 | 163 | if (dev->descriptor.bDescriptorType == USB_DT_DEVICE) { |
164 | 164 | printf("%d: %s, USB Revision %x.%x\n", dev->devnum, |
... | ... | @@ -192,8 +192,8 @@ |
192 | 192 | |
193 | 193 | } |
194 | 194 | |
195 | -void usb_display_conf_desc(struct usb_configuration_descriptor *config, | |
196 | - struct usb_device *dev) | |
195 | +static void usb_display_conf_desc(struct usb_configuration_descriptor *config, | |
196 | + struct usb_device *dev) | |
197 | 197 | { |
198 | 198 | printf(" Configuration: %d\n", config->bConfigurationValue); |
199 | 199 | printf(" - Interfaces: %d %s%s%dmA\n", config->bNumInterfaces, |
... | ... | @@ -207,8 +207,8 @@ |
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | -void usb_display_if_desc(struct usb_interface_descriptor *ifdesc, | |
211 | - struct usb_device *dev) | |
210 | +static void usb_display_if_desc(struct usb_interface_descriptor *ifdesc, | |
211 | + struct usb_device *dev) | |
212 | 212 | { |
213 | 213 | printf(" Interface: %d\n", ifdesc->bInterfaceNumber); |
214 | 214 | printf(" - Alternate Setting %d, Endpoints: %d\n", |
... | ... | @@ -224,7 +224,7 @@ |
224 | 224 | } |
225 | 225 | } |
226 | 226 | |
227 | -void usb_display_ep_desc(struct usb_endpoint_descriptor *epdesc) | |
227 | +static void usb_display_ep_desc(struct usb_endpoint_descriptor *epdesc) | |
228 | 228 | { |
229 | 229 | printf(" - Endpoint %d %s ", epdesc->bEndpointAddress & 0xf, |
230 | 230 | (epdesc->bEndpointAddress & 0x80) ? "In" : "Out"); |
... | ... | @@ -249,7 +249,7 @@ |
249 | 249 | } |
250 | 250 | |
251 | 251 | /* main routine to diasplay the configs, interfaces and endpoints */ |
252 | -void usb_display_config(struct usb_device *dev) | |
252 | +static void usb_display_config(struct usb_device *dev) | |
253 | 253 | { |
254 | 254 | struct usb_config *config; |
255 | 255 | struct usb_interface *ifdesc; |
... | ... | @@ -280,7 +280,7 @@ |
280 | 280 | } |
281 | 281 | |
282 | 282 | /* shows the device tree recursively */ |
283 | -void usb_show_tree_graph(struct usb_device *dev, char *pre) | |
283 | +static void usb_show_tree_graph(struct usb_device *dev, char *pre) | |
284 | 284 | { |
285 | 285 | int i, index; |
286 | 286 | int has_child, last_child; |
... | ... | @@ -340,7 +340,7 @@ |
340 | 340 | } |
341 | 341 | |
342 | 342 | /* main routine for the tree command */ |
343 | -void usb_show_tree(struct usb_device *dev) | |
343 | +static void usb_show_tree(struct usb_device *dev) | |
344 | 344 | { |
345 | 345 | char preamble[32]; |
346 | 346 | |
... | ... | @@ -353,7 +353,7 @@ |
353 | 353 | * usb boot command intepreter. Derived from diskboot |
354 | 354 | */ |
355 | 355 | #ifdef CONFIG_USB_STORAGE |
356 | -int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
356 | +static int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
357 | 357 | { |
358 | 358 | return common_diskboot(cmdtp, "usb", argc, argv); |
359 | 359 | } |
... | ... | @@ -363,7 +363,7 @@ |
363 | 363 | /****************************************************************************** |
364 | 364 | * usb command intepreter |
365 | 365 | */ |
366 | -int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
366 | +static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
367 | 367 | { |
368 | 368 | |
369 | 369 | int i; |
common/cmd_version.c
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | |
29 | 29 | const char __weak version_string[] = U_BOOT_VERSION_STRING; |
30 | 30 | |
31 | -int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
31 | +static int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | |
32 | 32 | { |
33 | 33 | printf("\n%s\n", version_string); |
34 | 34 | #ifdef CC_VERSION_STRING |
common/cmd_ximg.c
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | #define CONFIG_SYS_XIMG_LEN 0x800000 |
43 | 43 | #endif |
44 | 44 | |
45 | -int | |
45 | +static int | |
46 | 46 | do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
47 | 47 | { |
48 | 48 | ulong addr = load_addr; |
... | ... | @@ -264,9 +264,8 @@ |
264 | 264 | return 0; |
265 | 265 | } |
266 | 266 | |
267 | -U_BOOT_CMD( | |
268 | - imxtract, 4, 1, do_imgextract, | |
269 | - "extract a part of a multi-image", | |
267 | +#ifdef CONFIG_SYS_LONGHELP | |
268 | +static char imgextract_help_text[] = | |
270 | 269 | "addr part [dest]\n" |
271 | 270 | " - extract <part> from legacy image at <addr> and copy to <dest>" |
272 | 271 | #if defined(CONFIG_FIT) |
... | ... | @@ -274,5 +273,11 @@ |
274 | 273 | "addr uname [dest]\n" |
275 | 274 | " - extract <uname> subimage from FIT image at <addr> and copy to <dest>" |
276 | 275 | #endif |
276 | + ""; | |
277 | +#endif | |
278 | + | |
279 | +U_BOOT_CMD( | |
280 | + imxtract, 4, 1, do_imgextract, | |
281 | + "extract a part of a multi-image", imgextract_help_text | |
277 | 282 | ); |