[Qemu-devel] [PATCH 1/3] ahci: trim signatures on raise/lower

John Snow posted 3 patches 7 years, 5 months ago
[Qemu-devel] [PATCH 1/3] ahci: trim signatures on raise/lower
Posted by John Snow 7 years, 5 months ago
These functions work on the AHCI device, not the individual
AHCI devices, so trim the AHCIDevice argument.

Signed-off-by: John Snow <jsnow@redhat.com>
---
 hw/ide/ahci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index e22d7be05f..b7a6f68790 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -131,7 +131,7 @@ static uint32_t  ahci_port_read(AHCIState *s, int port, int offset)
     return val;
 }
 
-static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
+static void ahci_irq_raise(AHCIState *s)
 {
     DeviceState *dev_state = s->container;
     PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
@@ -146,7 +146,7 @@ static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
     }
 }
 
-static void ahci_irq_lower(AHCIState *s, AHCIDevice *dev)
+static void ahci_irq_lower(AHCIState *s)
 {
     DeviceState *dev_state = s->container;
     PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
@@ -174,9 +174,9 @@ static void ahci_check_irq(AHCIState *s)
     trace_ahci_check_irq(s, old_irq, s->control_regs.irqstatus);
     if (s->control_regs.irqstatus &&
         (s->control_regs.ghc & HOST_CTL_IRQ_EN)) {
-            ahci_irq_raise(s, NULL);
+            ahci_irq_raise(s);
     } else {
-        ahci_irq_lower(s, NULL);
+        ahci_irq_lower(s);
     }
 }
 
-- 
2.14.3


Re: [Qemu-devel] [PATCH 1/3] ahci: trim signatures on raise/lower
Posted by Eric Blake 7 years, 5 months ago
On 05/30/2018 07:43 PM, John Snow wrote:
> These functions work on the AHCI device, not the individual

s/device/state/ ?

> AHCI devices, so trim the AHCIDevice argument.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>   hw/ide/ahci.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 1/3] ahci: trim signatures on raise/lower
Posted by John Snow 7 years, 5 months ago

On 05/31/2018 10:56 AM, Eric Blake wrote:
> On 05/30/2018 07:43 PM, John Snow wrote:
>> These functions work on the AHCI device, not the individual
> 
> s/device/state/ ?
> 

It's confusing; the AHCI device itself (the HBA) is represented by the
struct AHCIState. the SATA devices are referred to by "AHCIDevice".

Not great names, admittedly.

--js

>> AHCI devices, so trim the AHCIDevice argument.
>>
>> Signed-off-by: John Snow <jsnow@redhat.com>
>> ---
>>   hw/ide/ahci.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
> 

Re: [Qemu-devel] [Qemu-block] [PATCH 1/3] ahci: trim signatures on raise/lower
Posted by Jeff Cody 7 years, 5 months ago
On Wed, May 30, 2018 at 08:43:21PM -0400, John Snow wrote:
> These functions work on the AHCI device, not the individual
> AHCI devices, so trim the AHCIDevice argument.
> 
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  hw/ide/ahci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index e22d7be05f..b7a6f68790 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -131,7 +131,7 @@ static uint32_t  ahci_port_read(AHCIState *s, int port, int offset)
>      return val;
>  }
>  
> -static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
> +static void ahci_irq_raise(AHCIState *s)
>  {
>      DeviceState *dev_state = s->container;
>      PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
> @@ -146,7 +146,7 @@ static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
>      }
>  }
>  
> -static void ahci_irq_lower(AHCIState *s, AHCIDevice *dev)
> +static void ahci_irq_lower(AHCIState *s)
>  {
>      DeviceState *dev_state = s->container;
>      PCIDevice *pci_dev = (PCIDevice *) object_dynamic_cast(OBJECT(dev_state),
> @@ -174,9 +174,9 @@ static void ahci_check_irq(AHCIState *s)
>      trace_ahci_check_irq(s, old_irq, s->control_regs.irqstatus);
>      if (s->control_regs.irqstatus &&
>          (s->control_regs.ghc & HOST_CTL_IRQ_EN)) {
> -            ahci_irq_raise(s, NULL);
> +            ahci_irq_raise(s);
>      } else {
> -        ahci_irq_lower(s, NULL);
> +        ahci_irq_lower(s);
>      }
>  }
>  
> -- 
> 2.14.3
> 
> 

Reviewed-by: Jeff Cody <jcody@redhat.com>