efi_loader: limit output length for VenHw, VenMedia
[pandora-u-boot.git] / cmd / sysboot.c
index 965799a..af6a2f1 100644 (file)
@@ -8,7 +8,8 @@
 
 static char *fs_argv[5];
 
-static int do_get_ext2(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_ext2(struct cmd_tbl *cmdtp, const char *file_path,
+                      char *file_addr)
 {
 #ifdef CONFIG_CMD_EXT2
        fs_argv[0] = "ext2load";
@@ -21,7 +22,8 @@ static int do_get_ext2(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
        return -ENOENT;
 }
 
-static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_fat(struct cmd_tbl *cmdtp, const char *file_path,
+                     char *file_addr)
 {
 #ifdef CONFIG_CMD_FAT
        fs_argv[0] = "fatload";
@@ -34,7 +36,8 @@ static int do_get_fat(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
        return -ENOENT;
 }
 
-static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
+static int do_get_any(struct cmd_tbl *cmdtp, const char *file_path,
+                     char *file_addr)
 {
 #ifdef CONFIG_CMD_FS_GENERIC
        fs_argv[0] = "load";
@@ -52,7 +55,8 @@ static int do_get_any(cmd_tbl_t *cmdtp, const char *file_path, char *file_addr)
  *
  * Returns 0 on success, 1 on error.
  */
-static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_sysboot(struct cmd_tbl *cmdtp, int flag, int argc,
+                     char *const argv[])
 {
        unsigned long pxefile_addr_r;
        struct pxe_menu *cfg;
@@ -79,20 +83,20 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                pxefile_addr_str = argv[4];
        }
 
-       if (argc < 6)
+       if (argc < 6) {
                filename = env_get("bootfile");
-       else {
+       else {
                filename = argv[5];
                env_set("bootfile", filename);
        }
 
-       if (strstr(argv[3], "ext2"))
+       if (strstr(argv[3], "ext2")) {
                do_getfile = do_get_ext2;
-       else if (strstr(argv[3], "fat"))
+       } else if (strstr(argv[3], "fat")) {
                do_getfile = do_get_fat;
-       else if (strstr(argv[3], "any"))
+       } else if (strstr(argv[3], "any")) {
                do_getfile = do_get_any;
-       else {
+       else {
                printf("Invalid filesystem: %s\n", argv[3]);
                return 1;
        }
@@ -111,7 +115,7 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
        cfg = parse_pxefile(cmdtp, pxefile_addr_r);
 
-       if (cfg == NULL) {
+       if (!cfg) {
                printf("Error parsing config file\n");
                return 1;
        }
@@ -126,10 +130,9 @@ static int do_sysboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        return 0;
 }
 
-U_BOOT_CMD(
-       sysboot, 7, 1, do_sysboot,
-       "command to get and boot from syslinux files",
-       "[-p] <interface> <dev[:part]> <ext2|fat|any> [addr] [filename]\n"
-       "    - load and parse syslinux menu file 'filename' from ext2, fat\n"
-       "      or any filesystem on 'dev' on 'interface' to address 'addr'"
+U_BOOT_CMD(sysboot, 7, 1, do_sysboot,
+          "command to get and boot from syslinux files",
+          "[-p] <interface> <dev[:part]> <ext2|fat|any> [addr] [filename]\n"
+          "    - load and parse syslinux menu file 'filename' from ext2, fat\n"
+          "      or any filesystem on 'dev' on 'interface' to address 'addr'"
 );