X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=cmd%2Fcbfs.c;h=ece790e56e4fab531a7e377f99c8144a0525b398;hb=05855fd31a3f7483534aabe69a7030ff38978510;hp=35d8a7a89bfbea6a12a11d4269528d53133b6aee;hpb=b72ae192e39f933100b0eb034768cb4daeebf67a;p=oweals%2Fu-boot.git diff --git a/cmd/cbfs.c b/cmd/cbfs.c index 35d8a7a89b..ece790e56e 100644 --- a/cmd/cbfs.c +++ b/cmd/cbfs.c @@ -1,7 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. - * - * SPDX-License-Identifier: GPL-2.0+ */ /* @@ -11,7 +10,8 @@ #include #include -int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +static int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) { uintptr_t end_of_rom = 0xffffffff; char *ep; @@ -21,7 +21,7 @@ int do_cbfs_init(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) return 0; } if (argc == 2) { - end_of_rom = (int)simple_strtoul(argv[1], &ep, 16); + end_of_rom = simple_strtoul(argv[1], &ep, 16); if (*ep) { puts("\n** Invalid end of ROM **\n"); return 1; @@ -44,7 +44,8 @@ U_BOOT_CMD( " CBFS is in. It defaults to 0xFFFFFFFF\n" ); -int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +static int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) { const struct cbfs_cachenode *file; unsigned long offset; @@ -78,7 +79,7 @@ int do_cbfs_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) printf("\n%ld bytes read\n", size); - setenv_hex("filesize", size); + env_set_hex("filesize", size); return 0; } @@ -90,7 +91,8 @@ U_BOOT_CMD( " - load binary file 'filename' from the cbfs to address 'addr'\n" ); -int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +static int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) { const struct cbfs_cachenode *file = file_cbfs_get_first(); int files = 0; @@ -103,7 +105,7 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) printf(" size type name\n"); printf("------------------------------------------\n"); while (file) { - u32 type = file_cbfs_type(file); + int type = file_cbfs_type(file); char *type_name = NULL; const char *filename = file_cbfs_name(file); @@ -140,7 +142,8 @@ int do_cbfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) case CBFS_COMPONENT_CMOS_LAYOUT: type_name = "cmos layout"; break; - case -1UL: + case -1: + case 0: type_name = "null"; break; } @@ -167,7 +170,8 @@ U_BOOT_CMD( " - list the files in the cbfs\n" ); -int do_cbfs_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) +static int do_cbfs_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, + char *const argv[]) { const struct cbfs_header *header = file_cbfs_get_header();