Re: [PATCH] virtio, ring: Use ALIGN macros in virtio_ring.h

2011-04-26 Thread Liu Yuan
On 04/26/2011 03:42 PM, Michael S. Tsirkin wrote:
 On Tue, Apr 26, 2011 at 12:11:10PM +0800, Liu Yuan wrote:
 From: Liu Yuantailai...@taobao.com


 Signed-off-by: Liu Yuantailai...@taobao.com
 Issue is, these functions are exported to userspace,
 which does not have these macros.

Ah, thanks, I should have noticed the '#ifdef __KERNEL__' just below the 
lines I touched.

Thanks,
Yuan
___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization


[PATCH] driver, virtio: Modify the err hanlding logic

2011-04-20 Thread Liu Yuan
From: Liu Yuan tailai...@taobao.com

In the function vp_request_msix_vectors(), when
pci_enable_msix() returns 0, there will be
redundant double checks for 'err'. This patch
fixes it to avoid the unnecessary check.

Signed-off-by: Liu Yuan tailai...@taobao.com
---
 drivers/virtio/virtio_pci.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index 4fb5b2b..2c05376 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -298,10 +298,11 @@ static int vp_request_msix_vectors(struct virtio_device 
*vdev, int nvectors,
 
/* pci_enable_msix returns positive if we can't get this many. */
err = pci_enable_msix(vp_dev-pci_dev, vp_dev-msix_entries, nvectors);
-   if (err  0)
-   err = -ENOSPC;
-   if (err)
+   if (err) {
+   if (err  0)
+   err = -ENOSPC;
goto error;
+   }
vp_dev-msix_vectors = nvectors;
vp_dev-msix_enabled = 1;
 
-- 
1.7.1

___
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/virtualization