Skip to contentSkip to conversation

cmd: blk: Use LBAFU in the common block command

PATCH Superseded Bin Meng 1 participant 2 messages Aug 22, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author
#1 lore raw

PATCH 1/1 cmd: blk: Use LBAFU in the common block command

In reply to Bin Meng
Quoted 10 lines · Bin Meng

There is already a macro LBAFU to aid formatted print with lbaint_t variables. Let's use it in the common block command codes.

---

Changes in v2:
- Change to use LBAFU

Oops, forget to prefix the email title with v2.

Quoted 22 lines
 cmd/blk_common.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
cmd/blk_common.c +2 -3
index 86c75e7..0c0c23e 100644
@@ -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;

cmd/blk_common.c int blk_common_cmd(int argc, char * const argv[], enum if_type if_type,

Quoted 10 lines
cmd/blk_common.c +2 -4
 
-                       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);
--

Regards,
Bin

Bin Meng

author
#0 lore raw

PATCH 1/1 cmd: blk: Use LBAFU in the common block command

There is already a macro LBAFU to aid formatted print with lbaint_t variables. Let's use it in the common block command codes.

---

Changes in v2:
- Change to use LBAFU

 cmd/blk_common.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
cmd/blk_common.c +4 -6
index 86c75e7..0c0c23e 100644
@@ -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);
Signature · 1 line
2.9.2