X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=common%2Fcmd_zfs.c;h=0aed29e9b2c8989d86c3ff14fad67feca692b1f8;hb=2475e634758577baad4a54f4585c7fa9a638ae73;hp=27f88563d7239c4eab563768b68ac09408ba6546;hpb=412045704477a9b4d46b7e1fddbd53ec5dcde155;p=karo-tx-uboot.git diff --git a/common/cmd_zfs.c b/common/cmd_zfs.c index 27f88563d7..0aed29e9b2 100644 --- a/common/cmd_zfs.c +++ b/common/cmd_zfs.c @@ -6,21 +6,7 @@ * zfsfs support * made from existing GRUB Sources by Sun, GNU and others. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * + * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -46,7 +32,7 @@ #define DOS_FS_TYPE_OFFSET 0x36 #define DOS_FS32_TYPE_OFFSET 0x52 -static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { char *filename = NULL; int dev; @@ -94,7 +80,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } - part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info); + part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info, 1); if (part < 0) return 1; @@ -109,7 +95,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) memset(&zfile, 0, sizeof(zfile)); zfile.device = &vdev; if (zfs_open(&zfile, filename)) { - printf("** File not found %s\n", filename); + printf("** File not found %s **\n", filename); return 1; } @@ -129,8 +115,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) load_addr = addr; printf("%llu bytes read\n", zfile.size); - sprintf(buf, "%llX", zfile.size); - setenv("filesize", buf); + setenv_hex("filesize", zfile.size); return 0; } @@ -146,7 +131,7 @@ int zfs_print(const char *entry, const struct zfs_dirhook_info *data) -static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { const char *filename = "/"; int part; @@ -160,7 +145,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (argc == 4) filename = argv[3]; - part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info); + part = get_device_and_partition(argv[1], argv[2], &dev_desc, &info, 1); if (part < 0) return 1;