efi_loader: limit output length for VenHw, VenMedia
[pandora-u-boot.git] / cmd / blk_common.c
index 86c75e7..87f94b5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Handling of common block commands
  *
@@ -5,15 +6,13 @@
  *
  * (C) Copyright 2000-2011
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <blk.h>
+#include <command.h>
 
-#ifdef HAVE_BLOCK_DEVICE
-int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
+int blk_common_cmd(int argc, char *const argv[], enum if_type if_type,
                   int *cur_devnump)
 {
        const char *if_name = blk_get_if_type_name(if_type);
@@ -34,7 +33,8 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
                        return 0;
                } else if (strncmp(argv[1], "part", 4) == 0) {
                        if (blk_list_part(if_type))
-                               printf("\nno %s devices available\n", if_name);
+                               printf("\nno %s partition table available\n",
+                                      if_name);
                        return 0;
                }
                return CMD_RET_USAGE;
@@ -68,9 +68,8 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
                        ulong cnt = simple_strtoul(argv[4], NULL, 16);
                        ulong n;
 
-                       printf("\n%s read: device %d block # %lld, count %ld ... ",
-                              if_name, *cur_devnump, (unsigned long long)blk,
-                              cnt);
+                       printf("\n%s read: device %d block # "LBAFU", count %lu ... ",
+                              if_name, *cur_devnump, blk, cnt);
 
                        n = blk_read_devnum(if_type, *cur_devnump, blk, cnt,
                                            (ulong *)addr);
@@ -84,9 +83,8 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
                        ulong cnt = simple_strtoul(argv[4], NULL, 16);
                        ulong n;
 
-                       printf("\n%s write: device %d block # %lld, count %ld ... ",
-                              if_name, *cur_devnump, (unsigned long long)blk,
-                              cnt);
+                       printf("\n%s write: device %d block # "LBAFU", count %lu ... ",
+                              if_name, *cur_devnump, blk, cnt);
 
                        n = blk_write_devnum(if_type, *cur_devnump, blk, cnt,
                                             (ulong *)addr);
@@ -97,8 +95,5 @@ int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,
                } else {
                        return CMD_RET_USAGE;
                }
-
-               return 0;
        }
 }
-#endif