Re: [Qemu-devel] [PATCH v6 04/11] megasas: Fix

2016-06-01 Thread Markus Armbruster
Title "megasas: Fix" is no good, possibly an editing accident.  Suggest
something like "megasas: Fix check for msi_init() failure"

Cao jin  writes:

> msi_init returns non-zero value on both failure and success.
>
> cc: Hannes Reinecke 
> cc: Paolo Bonzini 
> cc: Marcel Apfelbaum 
>
> Reviewed-by: Marcel Apfelbaum 
> Signed-off-by: Cao jin 
> ---
>  hw/scsi/megasas.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index a63a581..56fb645 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2348,7 +2348,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error 
> **errp)
>"megasas-queue", 0x4);
>  
>  if (megasas_use_msi(s) &&
> -msi_init(dev, 0x50, 1, true, false)) {
> +msi_init(dev, 0x50, 1, true, false) < 0) {
>  s->flags &= ~MEGASAS_MASK_USE_MSI;
>  }
>  if (megasas_use_msix(s) &&



[Qemu-devel] [PATCH v6 04/11] megasas: Fix

2016-05-23 Thread Cao jin
msi_init returns non-zero value on both failure and success.

cc: Hannes Reinecke 
cc: Paolo Bonzini 
cc: Marcel Apfelbaum 

Reviewed-by: Marcel Apfelbaum 
Signed-off-by: Cao jin 
---
 hw/scsi/megasas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index a63a581..56fb645 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2348,7 +2348,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error 
**errp)
   "megasas-queue", 0x4);
 
 if (megasas_use_msi(s) &&
-msi_init(dev, 0x50, 1, true, false)) {
+msi_init(dev, 0x50, 1, true, false) < 0) {
 s->flags &= ~MEGASAS_MASK_USE_MSI;
 }
 if (megasas_use_msix(s) &&
-- 
2.1.0