@@ -264,7 +264,7 @@ impl VfioContainer {
264
264
match self . device_del_group ( & group) {
265
265
Ok ( _) => { }
266
266
Err ( e) => {
267
- error ! ( "Could not delete VFIO group: {:?}" , e ) ;
267
+ error ! ( "Could not delete VFIO group: {e :?}" ) ;
268
268
return ;
269
269
}
270
270
}
@@ -628,7 +628,7 @@ impl VfioDeviceInfo {
628
628
} ;
629
629
630
630
if vfio_syscall:: get_device_irq_info ( self , & mut irq_info) . is_err ( ) {
631
- warn ! ( "Could not get VFIO IRQ info for index {:}" , index ) ;
631
+ warn ! ( "Could not get VFIO IRQ info for index {index :}" ) ;
632
632
continue ;
633
633
}
634
634
@@ -638,7 +638,7 @@ impl VfioDeviceInfo {
638
638
count : irq_info. count ,
639
639
} ;
640
640
641
- debug ! ( "IRQ #{}" , index ) ;
641
+ debug ! ( "IRQ #{index}" ) ;
642
642
debug ! ( "\t flag 0x{:x}" , irq. flags) ;
643
643
debug ! ( "\t index {}" , irq. index) ;
644
644
debug ! ( "\t count {}" , irq. count) ;
@@ -780,7 +780,7 @@ impl VfioDeviceInfo {
780
780
continue ;
781
781
}
782
782
_ => {
783
- error ! ( "Could not get region #{} info {}" , i , e ) ;
783
+ error ! ( "Could not get region #{i } info {e}" ) ;
784
784
continue ;
785
785
}
786
786
}
@@ -793,11 +793,11 @@ impl VfioDeviceInfo {
793
793
caps : Vec :: new ( ) ,
794
794
} ;
795
795
if let Err ( e) = self . get_region_map ( & mut region, & reg_info) {
796
- error ! ( "Could not get region #{} map {}" , i , e ) ;
796
+ error ! ( "Could not get region #{i } map {e}" ) ;
797
797
continue ;
798
798
}
799
799
800
- debug ! ( "Region #{}" , i ) ;
800
+ debug ! ( "Region #{i}" ) ;
801
801
debug ! ( "\t flag 0x{:x}" , region. flags) ;
802
802
debug ! ( "\t size 0x{:x}" , region. size) ;
803
803
debug ! ( "\t offset 0x{:x}" , region. offset) ;
@@ -1104,7 +1104,7 @@ impl VfioDevice {
1104
1104
match self . regions . get ( index as usize ) {
1105
1105
Some ( v) => v. size ,
1106
1106
None => {
1107
- warn ! ( "get_region_size with invalid index: {}" , index ) ;
1107
+ warn ! ( "get_region_size with invalid index: {index}" ) ;
1108
1108
0
1109
1109
}
1110
1110
}
@@ -1118,7 +1118,7 @@ impl VfioDevice {
1118
1118
match self . regions . get ( index as usize ) {
1119
1119
Some ( v) => v. caps . clone ( ) ,
1120
1120
None => {
1121
- warn ! ( "get_region_caps with invalid index: {}" , index ) ;
1121
+ warn ! ( "get_region_caps with invalid index: {index}" ) ;
1122
1122
Vec :: new ( )
1123
1123
}
1124
1124
}
@@ -1134,25 +1134,19 @@ impl VfioDevice {
1134
1134
let region: & VfioRegion = match self . regions . get ( index as usize ) {
1135
1135
Some ( v) => v,
1136
1136
None => {
1137
- warn ! ( "region read with invalid index: {}" , index ) ;
1137
+ warn ! ( "region read with invalid index: {index}" ) ;
1138
1138
return ;
1139
1139
}
1140
1140
} ;
1141
1141
1142
1142
let size = buf. len ( ) as u64 ;
1143
1143
if size > region. size || addr + size > region. size {
1144
- warn ! (
1145
- "region read with invalid parameter, add: {}, size: {}" ,
1146
- addr, size
1147
- ) ;
1144
+ warn ! ( "region read with invalid parameter, add: {addr}, size: {size}" ) ;
1148
1145
return ;
1149
1146
}
1150
1147
1151
1148
if let Err ( e) = self . device . read_exact_at ( buf, region. offset + addr) {
1152
- warn ! (
1153
- "Failed to read region in index: {}, addr: {}, error: {}" ,
1154
- index, addr, e
1155
- ) ;
1149
+ warn ! ( "Failed to read region in index: {index}, addr: {addr}, error: {e}" ) ;
1156
1150
}
1157
1151
}
1158
1152
@@ -1166,7 +1160,7 @@ impl VfioDevice {
1166
1160
let stub: & VfioRegion = match self . regions . get ( index as usize ) {
1167
1161
Some ( v) => v,
1168
1162
None => {
1169
- warn ! ( "region write with invalid index: {}" , index ) ;
1163
+ warn ! ( "region write with invalid index: {index}" ) ;
1170
1164
return ;
1171
1165
}
1172
1166
} ;
@@ -1176,18 +1170,12 @@ impl VfioDevice {
1176
1170
|| addr + size > stub. size
1177
1171
|| ( stub. flags & VFIO_REGION_INFO_FLAG_WRITE ) == 0
1178
1172
{
1179
- warn ! (
1180
- "region write with invalid parameter, add: {}, size: {}" ,
1181
- addr, size
1182
- ) ;
1173
+ warn ! ( "region write with invalid parameter, add: {addr}, size: {size}" ) ;
1183
1174
return ;
1184
1175
}
1185
1176
1186
1177
if let Err ( e) = self . device . write_all_at ( buf, stub. offset + addr) {
1187
- warn ! (
1188
- "Failed to write region in index: {}, addr: {}, error: {}" ,
1189
- index, addr, e
1190
- ) ;
1178
+ warn ! ( "Failed to write region in index: {index}, addr: {addr}, error: {e}" ) ;
1191
1179
}
1192
1180
}
1193
1181
0 commit comments