diff mbox series

[kvm-unit-tests,v3,3/4] lib: Remove redundant page zeroing

Message ID 20190509200558.12347-4-nadav.amit@gmail.com (mailing list archive)
State New, archived
Headers show
Series Zero allocated pages | expand

Commit Message

Nadav Amit May 9, 2019, 8:05 p.m. UTC
Now that alloc_page() zeros the page, remove the redundant page zeroing.

Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Suggested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
---
 lib/virtio-mmio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Andrew Jones May 15, 2019, 9:19 a.m. UTC | #1
On Thu, May 09, 2019 at 01:05:57PM -0700, Nadav Amit wrote:
> Now that alloc_page() zeros the page, remove the redundant page zeroing.
> 
> Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> Suggested-by: Andrew Jones <drjones@redhat.com>
> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> ---
>  lib/virtio-mmio.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/lib/virtio-mmio.c b/lib/virtio-mmio.c
> index 57fe78e..e5e8f66 100644
> --- a/lib/virtio-mmio.c
> +++ b/lib/virtio-mmio.c
> @@ -56,7 +56,6 @@ static struct virtqueue *vm_setup_vq(struct virtio_device *vdev,
>  	vq = calloc(1, sizeof(*vq));
>  	assert(VIRTIO_MMIO_QUEUE_SIZE_MIN <= 2*PAGE_SIZE);
>  	queue = alloc_pages(1);
> -	memset(queue, 0, 2*PAGE_SIZE);
>  	assert(vq && queue);
>  
>  	writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);
> -- 
> 2.17.1
>

Reviewed-by: Andrew Jones <drjones@redhat.com>
diff mbox series

Patch

diff --git a/lib/virtio-mmio.c b/lib/virtio-mmio.c
index 57fe78e..e5e8f66 100644
--- a/lib/virtio-mmio.c
+++ b/lib/virtio-mmio.c
@@ -56,7 +56,6 @@  static struct virtqueue *vm_setup_vq(struct virtio_device *vdev,
 	vq = calloc(1, sizeof(*vq));
 	assert(VIRTIO_MMIO_QUEUE_SIZE_MIN <= 2*PAGE_SIZE);
 	queue = alloc_pages(1);
-	memset(queue, 0, 2*PAGE_SIZE);
 	assert(vq && queue);
 
 	writel(index, vm_dev->base + VIRTIO_MMIO_QUEUE_SEL);