Skip to contentSkip to conversation

virtio: drop a useless config read

PATCH Applied Michael S. Tsirkin 3 participants 4 messages Mar 31, 2015 – Apr 1, 2015 virtio core

lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

PATCH 1/1 virtio: drop a useless config read

commit d71de9ec6ba806104439d3a669befda84757b5af
"virtio: core support for config generation"
fixed reading up 64 bit values, adding generation checks for such reads.

By mistake, it left an explicit get call in place as well. the result is that the value is read twice, the first result is discarded.

Not a big deal since this only happens with virtio blk and only on boot ATM, so performance isn't affected, but let's clean it up.

---
 include/linux/virtio_config.h | 1 -
 1 file changed, 1 deletion(-)
include/linux/virtio_config.h +0 -1
index ca3ed78..ed1e0d5 100644
@@ -374,7 +374,6 @@ static inline u64 virtio_cread64(struct virtio_device *vdev,
 				 unsigned int offset)
 {
 	u64 ret;
-	vdev->config->get(vdev, offset, &ret, sizeof(ret));
 	__virtio_cread_many(vdev, offset, &ret, 1, sizeof(ret));
 	return virtio64_to_cpu(vdev, (__force __virtio64)ret);
 }
Signature · 1 line
MST
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, 31 Mar 2015 13:55:42 +0200 "Michael S. Tsirkin" <[email protected]> wrote:

commit d71de9ec6ba806104439d3a669befda84757b5af
"virtio: core support for config generation"
fixed reading up 64 bit values, adding generation checks for such reads.

By mistake, it left an explicit get call in place as well. the result is that the value is read twice, the first result is discarded.

Quoted 8 lines

Not a big deal since this only happens with virtio blk and only on boot ATM, so performance isn't affected, but let's clean it up.

---
 include/linux/virtio_config.h | 1 -
 1 file changed, 1 deletion(-)
#2 lore raw
Quoted 16 lines · Cornelia Huck
Quoted 13 lines · On Tue, 31 Mar 2015 13:55:42 +0200 "Michael S. Tsirkin" <[email protected]> wrote:

commit d71de9ec6ba806104439d3a669befda84757b5af
"virtio: core support for config generation"
fixed reading up 64 bit values, adding generation checks for such reads.

By mistake, it left an explicit get call in place as well. the result is that the value is read twice, the first result is discarded.

Not a big deal since this only happens with virtio blk and only on boot ATM, so performance isn't affected, but let's clean it up.

Quoted 6 lines
Quoted 4 lines
---
 include/linux/virtio_config.h | 1 -
 1 file changed, 1 deletion(-)

Applied.

Thanks!
Rusty.

#3 lore raw
In reply to Cornelia Huck
Quoted 16 lines · Cornelia Huck
Quoted 13 lines · On Tue, 31 Mar 2015 13:55:42 +0200 "Michael S. Tsirkin" <[email protected]> wrote:

commit d71de9ec6ba806104439d3a669befda84757b5af
"virtio: core support for config generation"
fixed reading up 64 bit values, adding generation checks for such reads.

By mistake, it left an explicit get call in place as well. the result is that the value is read twice, the first result is discarded.

Not a big deal since this only happens with virtio blk and only on boot ATM, so performance isn't affected, but let's clean it up.

Quoted 6 lines
Quoted 4 lines
---
 include/linux/virtio_config.h | 1 -
 1 file changed, 1 deletion(-)

Applied.

Thanks!
Rusty.