@@ -878,7 +878,7 @@ static void stdout_fdp_usage(struct nvme_fdp_ruhu_log *log, size_t len)
878
878
for (int i = 0 ; i < nruh ; i ++ ) {
879
879
struct nvme_fdp_ruhu_desc * ruhu = & log -> ruhus [i ];
880
880
881
- printf ("Reclaim Unit Handle %d Attributes: 0x% " PRIx8 " (%s)\n" , i , ruhu -> ruha ,
881
+ printf ("Reclaim Unit Handle %d Attributes: %# " PRIx8 " (%s)\n" , i , ruhu -> ruha ,
882
882
ruhu -> ruha == 0x0 ? "Unused" : (
883
883
ruhu -> ruha == 0x1 ? "Host Specified" : (
884
884
ruhu -> ruha == 0x2 ? "Controller Specified" : "Unknown" )));
@@ -909,13 +909,13 @@ static void stdout_fdp_events(struct nvme_fdp_events_log *log)
909
909
tm = localtime (& ts );
910
910
911
911
printf ("Event[%u]\n" , i );
912
- printf (" Event Type: 0x% " PRIx8 " (%s)\n" , event -> type ,
912
+ printf (" Event Type: %# " PRIx8 " (%s)\n" , event -> type ,
913
913
nvme_fdp_event_to_string (event -> type ));
914
914
printf (" Event Timestamp: %" PRIu64 " (%s)\n" , int48_to_long (event -> ts .timestamp ),
915
915
strftime (buffer , sizeof (buffer ), "%c %Z" , tm ) ? buffer : "-" );
916
916
917
917
if (event -> flags & NVME_FDP_EVENT_F_PIV )
918
- printf (" Placement Identifier (PID): 0x% " PRIx16 "\n" ,
918
+ printf (" Placement Identifier (PID): %# " PRIx16 "\n" ,
919
919
le16_to_cpu (event -> pid ));
920
920
921
921
if (event -> flags & NVME_FDP_EVENT_F_NSIDV )
@@ -929,7 +929,7 @@ static void stdout_fdp_events(struct nvme_fdp_events_log *log)
929
929
printf (" Number of LBAs Moved (NLBAM): %" PRIu16 "\n" , le16_to_cpu (mr -> nlbam ));
930
930
931
931
if (mr -> flags & NVME_FDP_EVENT_REALLOC_F_LBAV )
932
- printf (" Logical Block Address (LBA): 0x% " PRIx64 "\n" ,
932
+ printf (" Logical Block Address (LBA): %# " PRIx64 "\n" ,
933
933
le64_to_cpu (mr -> lba ));
934
934
}
935
935
@@ -1247,7 +1247,7 @@ static void stdout_registers_cmbloc(__u32 cmbloc, __u32 cmbsz)
1247
1247
return ;
1248
1248
}
1249
1249
printf ("\tOffset (OFST): " );
1250
- printf ("0x% x (See cmbsz.szu for granularity)\n" , (cmbloc & 0xfffff000 ) >> 12 );
1250
+ printf ("%# x (See cmbsz.szu for granularity)\n" , (cmbloc & 0xfffff000 ) >> 12 );
1251
1251
1252
1252
printf ("\tCMB Queue Dword Alignment (CQDA): %d\n" ,
1253
1253
(cmbloc & 0x00000100 ) >> 8 );
@@ -1267,7 +1267,7 @@ static void stdout_registers_cmbloc(__u32 cmbloc, __u32 cmbsz)
1267
1267
printf ("\tCMB Queue Mixed Memory Support (CQMMS): %s\n" ,
1268
1268
enforced [(cmbloc & 0x00000008 ) >> 3 ]);
1269
1269
1270
- printf ("\tBase Indicator Register (BIR): 0x% x\n\n" ,
1270
+ printf ("\tBase Indicator Register (BIR): %# x\n\n" ,
1271
1271
(cmbloc & 0x00000007 ));
1272
1272
}
1273
1273
@@ -1589,10 +1589,10 @@ static void stdout_single_property(int offset, uint64_t value64)
1589
1589
1590
1590
if (!human ) {
1591
1591
if (nvme_is_64bit_reg (offset ))
1592
- printf ("property: 0x% 02x (%s), value: %" PRIx64 "\n" ,
1592
+ printf ("property: %# 02x (%s), value: %# " PRIx64 "\n" ,
1593
1593
offset , nvme_register_to_string (offset ), value64 );
1594
1594
else
1595
- printf ("property: 0x% 02x (%s), value: %x\n" , offset ,
1595
+ printf ("property: %# 02x (%s), value: %# x\n" , offset ,
1596
1596
nvme_register_to_string (offset ), value32 );
1597
1597
return ;
1598
1598
}
@@ -1627,7 +1627,7 @@ static void stdout_single_property(int offset, uint64_t value64)
1627
1627
stdout_registers_crto (value32 );
1628
1628
break ;
1629
1629
default :
1630
- printf ("unknown property: 0x% 02x (%s), value: %" PRIx64 "\n" ,
1630
+ printf ("unknown property: %# 02x (%s), value: %" PRIx64 "\n" ,
1631
1631
offset , nvme_register_to_string (offset ), value64 );
1632
1632
break ;
1633
1633
}
@@ -3246,12 +3246,12 @@ static void stdout_zns_id_ns(struct nvme_zns_id_ns *ns,
3246
3246
3247
3247
for (i = 0 ; i <= id_ns -> nlbaf ; i ++ ) {
3248
3248
if (human )
3249
- printf ("LBA Format Extension %2d : Zone Size: 0x% " PRIx64 " LBAs - "
3249
+ printf ("LBA Format Extension %2d : Zone Size: %# " PRIx64 " LBAs - "
3250
3250
"Zone Descriptor Extension Size: %-1d bytes%s\n" ,
3251
3251
i , le64_to_cpu (ns -> lbafe [i ].zsze ), ns -> lbafe [i ].zdes << 6 ,
3252
3252
i == lbaf ? " (in use)" : "" );
3253
3253
else
3254
- printf ("lbafe %2d: zsze:0x% " PRIx64 " zdes:%u%s\n" , i ,
3254
+ printf ("lbafe %2d: zsze:%# " PRIx64 " zdes:%u%s\n" , i ,
3255
3255
(uint64_t )le64_to_cpu (ns -> lbafe [i ].zsze ),
3256
3256
ns -> lbafe [i ].zdes , i == lbaf ? " (in use)" : "" );
3257
3257
}
@@ -3442,18 +3442,18 @@ static void stdout_list_secondary_ctrl(const struct nvme_secondary_ctrl_list *sc
3442
3442
for (i = 0 ; i < entries ; i ++ ) {
3443
3443
printf (" SCEntry[%-3d]:\n" , i );
3444
3444
printf ("................\n" );
3445
- printf (" SCID : Secondary Controller Identifier : 0x% .04x\n" ,
3445
+ printf (" SCID : Secondary Controller Identifier : %# .04x\n" ,
3446
3446
le16_to_cpu (sc_entry [i ].scid ));
3447
- printf (" PCID : Primary Controller Identifier : 0x% .04x\n" ,
3447
+ printf (" PCID : Primary Controller Identifier : %# .04x\n" ,
3448
3448
le16_to_cpu (sc_entry [i ].pcid ));
3449
- printf (" SCS : Secondary Controller State : 0x% .04x (%s)\n" ,
3449
+ printf (" SCS : Secondary Controller State : %# .04x (%s)\n" ,
3450
3450
sc_entry [i ].scs ,
3451
3451
state_desc [sc_entry [i ].scs & 0x1 ]);
3452
- printf (" VFN : Virtual Function Number : 0x% .04x\n" ,
3452
+ printf (" VFN : Virtual Function Number : %# .04x\n" ,
3453
3453
le16_to_cpu (sc_entry [i ].vfn ));
3454
- printf (" NVQ : Num VQ Flex Resources Assigned : 0x% .04x\n" ,
3454
+ printf (" NVQ : Num VQ Flex Resources Assigned : %# .04x\n" ,
3455
3455
le16_to_cpu (sc_entry [i ].nvq ));
3456
- printf (" NVI : Num VI Flex Resources Assigned : 0x% .04x\n" ,
3456
+ printf (" NVI : Num VI Flex Resources Assigned : %# .04x\n" ,
3457
3457
le16_to_cpu (sc_entry [i ].nvi ));
3458
3458
}
3459
3459
}
@@ -3463,7 +3463,7 @@ static void stdout_id_ns_granularity_list(const struct nvme_id_ns_granularity_li
3463
3463
int i ;
3464
3464
3465
3465
printf ("Identify Namespace Granularity List:\n" );
3466
- printf (" ATTR : Namespace Granularity Attributes: 0x% x\n" ,
3466
+ printf (" ATTR : Namespace Granularity Attributes: %# x\n" ,
3467
3467
glist -> attributes );
3468
3468
printf (" NUMD : Number of Descriptors : %d\n" ,
3469
3469
glist -> num_descriptors );
@@ -3472,9 +3472,9 @@ static void stdout_id_ns_granularity_list(const struct nvme_id_ns_granularity_li
3472
3472
for (i = 0 ; i <= glist -> num_descriptors ; i ++ ) {
3473
3473
printf ("\n Entry[%2d] :\n" , i );
3474
3474
printf ("................\n" );
3475
- printf (" NSG : Namespace Size Granularity : 0x% " PRIx64 "\n" ,
3475
+ printf (" NSG : Namespace Size Granularity : %# " PRIx64 "\n" ,
3476
3476
le64_to_cpu (glist -> entry [i ].nszegran ));
3477
- printf (" NCG : Namespace Capacity Granularity : 0x% " PRIx64 "\n" ,
3477
+ printf (" NCG : Namespace Capacity Granularity : %# " PRIx64 "\n" ,
3478
3478
le64_to_cpu (glist -> entry [i ].ncapgran ));
3479
3479
}
3480
3480
}
@@ -3511,7 +3511,7 @@ static void stdout_id_uuid_list(const struct nvme_id_uuid_list *uuid_list)
3511
3511
}
3512
3512
printf (" Entry[%3d]\n" , i + 1 );
3513
3513
printf (".................\n" );
3514
- printf ("association : 0x% x %s\n" , identifier_association , association );
3514
+ printf ("association : %# x %s\n" , identifier_association , association );
3515
3515
printf ("UUID : %s" , util_uuid_to_string (uuid ));
3516
3516
if (memcmp (uuid_list -> entry [i ].uuid , invalid_uuid ,
3517
3517
sizeof (zero_uuid )) == 0 )
@@ -3825,7 +3825,7 @@ static void stdout_supported_log(struct nvme_supported_log_pages *support_log,
3825
3825
for (lid = 0 ; lid < 256 ; lid ++ ) {
3826
3826
support = le32_to_cpu (support_log -> lid_support [lid ]);
3827
3827
if (support & 0x1 ) {
3828
- printf ("LID 0x% x - %s\n" , lid , nvme_log_to_string (lid ));
3828
+ printf ("LID %# x - %s\n" , lid , nvme_log_to_string (lid ));
3829
3829
if (human )
3830
3830
stdout_support_log_human (support , lid );
3831
3831
}
@@ -4223,9 +4223,9 @@ static void stdout_host_mem_buffer(struct nvme_host_mem_buf_attrs *hmb)
4223
4223
{
4224
4224
printf ("\tHost Memory Descriptor List Entry Count (HMDLEC): %u\n" ,
4225
4225
le32_to_cpu (hmb -> hmdlec ));
4226
- printf ("\tHost Memory Descriptor List Address (HMDLAU): 0x% x\n" ,
4226
+ printf ("\tHost Memory Descriptor List Address (HMDLAU): %# x\n" ,
4227
4227
le32_to_cpu (hmb -> hmdlau ));
4228
- printf ("\tHost Memory Descriptor List Address (HMDLAL): 0x% x\n" ,
4228
+ printf ("\tHost Memory Descriptor List Address (HMDLAL): %# x\n" ,
4229
4229
le32_to_cpu (hmb -> hmdlal ));
4230
4230
printf ("\tHost Memory Buffer Size (HSIZE): %u\n" ,
4231
4231
le32_to_cpu (hmb -> hsize ));
@@ -4387,7 +4387,7 @@ static void stdout_host_metadata(enum nvme_features_id fid,
4387
4387
strncpy (val , (char * )desc -> val , min (sizeof (val ) - 1 , len ));
4388
4388
4389
4389
printf ("\tElement[%-3d]:\n" , i );
4390
- printf ("\t\tType : 0x% 02x (%s)\n" , desc -> type ,
4390
+ printf ("\t\tType : %# 02x (%s)\n" , desc -> type ,
4391
4391
nvme_host_metadata_type_to_string (fid , desc -> type ));
4392
4392
printf ("\t\tRevision : %d\n" , desc -> rev );
4393
4393
printf ("\t\tLength : %d\n" , len );
@@ -4636,7 +4636,7 @@ static void stdout_lba_status(struct nvme_lba_status *list,
4636
4636
for (idx = 0 ; idx < list -> nlsd ; idx ++ ) {
4637
4637
struct nvme_lba_status_desc * e = & list -> descs [idx ];
4638
4638
4639
- printf ("{ DSLBA: 0x% 016" PRIx64 ", NLB: 0x% 08x, Status: 0x% 02x }\n" ,
4639
+ printf ("{ DSLBA: %# 016" PRIx64 ", NLB: %# 08x, Status: %# 02x }\n" ,
4640
4640
le64_to_cpu (e -> dslba ), le32_to_cpu (e -> nlb ),
4641
4641
e -> status );
4642
4642
}
@@ -5101,7 +5101,7 @@ static void stdout_discovery_log(struct nvmf_discovery_log *log, int numrec)
5101
5101
nvmf_qptype_str (e -> tsas .rdma .qptype ));
5102
5102
printf ("rdma_cms: %s\n" ,
5103
5103
nvmf_cms_str (e -> tsas .rdma .cms ));
5104
- printf ("rdma_pkey: 0x% 04x\n" ,
5104
+ printf ("rdma_pkey: %# 04x\n" ,
5105
5105
le16_to_cpu (e -> tsas .rdma .pkey ));
5106
5106
break ;
5107
5107
case NVMF_TRTYPE_TCP :
0 commit comments