File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1290,11 +1290,10 @@ static inline int getu16_iotlb(const struct vringh *vrh,
1290
1290
if (ret )
1291
1291
return ret ;
1292
1292
} else {
1293
- void * kaddr = kmap_local_page (ivec .iov .bvec [0 ].bv_page );
1294
- void * from = kaddr + ivec .iov .bvec [0 ].bv_offset ;
1293
+ __virtio16 * from = bvec_kmap_local (& ivec .iov .bvec [0 ]);
1295
1294
1296
- tmp = READ_ONCE (* ( __virtio16 * ) from );
1297
- kunmap_local (kaddr );
1295
+ tmp = READ_ONCE (* from );
1296
+ kunmap_local (from );
1298
1297
}
1299
1298
1300
1299
* val = vringh16_to_cpu (vrh , tmp );
@@ -1329,11 +1328,10 @@ static inline int putu16_iotlb(const struct vringh *vrh,
1329
1328
if (ret )
1330
1329
return ret ;
1331
1330
} else {
1332
- void * kaddr = kmap_local_page (ivec .iov .bvec [0 ].bv_page );
1333
- void * to = kaddr + ivec .iov .bvec [0 ].bv_offset ;
1331
+ __virtio16 * to = bvec_kmap_local (& ivec .iov .bvec [0 ]);
1334
1332
1335
- WRITE_ONCE (* ( __virtio16 * ) to , tmp );
1336
- kunmap_local (kaddr );
1333
+ WRITE_ONCE (* to , tmp );
1334
+ kunmap_local (to );
1337
1335
}
1338
1336
1339
1337
return 0 ;
You can’t perform that action at this time.
0 commit comments