]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_zfs.c
tpm: Drop two unused options
[karo-tx-uboot.git] / common / cmd_zfs.c
index 27f88563d7239c4eab563768b68ac09408ba6546..0aed29e9b2c8989d86c3ff14fad67feca692b1f8 100644 (file)
@@ -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 <common.h>
@@ -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;