Patchwork [V6,08/32] pci: clean up pci_init_wmask()

login
register
mail settings
Submitter Isaku Yamahata
Date Oct. 30, 2009, 12:21 p.m.
Message ID <1256905286-25435-9-git-send-email-yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/37300/
State New
Headers show

Comments

Isaku Yamahata - Oct. 30, 2009, 12:21 p.m.
use pci_set_word() for pci command register.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pci.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Michael S. Tsirkin - Nov. 3, 2009, 1:22 p.m.
On Fri, Oct 30, 2009 at 09:21:02PM +0900, Isaku Yamahata wrote:
> use pci_set_word() for pci command register.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/pci.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 6abb0e2..84c7611 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -352,8 +352,8 @@ static void pci_init_wmask(PCIDevice *dev)
>      int i;
>      dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
>      dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
> -    dev->wmask[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY
> -                              | PCI_COMMAND_MASTER;
> +    pci_set_word(dev->wmask + PCI_COMMAND,
> +                 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
>      for (i = PCI_CONFIG_HEADER_SIZE; i < PCI_CONFIG_SPACE_SIZE; ++i)
>          dev->wmask[i] = 0xff;
>  }
> -- 
> 1.6.0.2
Michael S. Tsirkin - Nov. 10, 2009, 3:26 p.m.
On Fri, Oct 30, 2009 at 09:21:02PM +0900, Isaku Yamahata wrote:
> use pci_set_word() for pci command register.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

I thought I acked this already. It's an obvious one.

> ---
>  hw/pci.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 6abb0e2..84c7611 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -352,8 +352,8 @@ static void pci_init_wmask(PCIDevice *dev)
>      int i;
>      dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
>      dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
> -    dev->wmask[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY
> -                              | PCI_COMMAND_MASTER;
> +    pci_set_word(dev->wmask + PCI_COMMAND,
> +                 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
>      for (i = PCI_CONFIG_HEADER_SIZE; i < PCI_CONFIG_SPACE_SIZE; ++i)
>          dev->wmask[i] = 0xff;
>  }
> -- 
> 1.6.0.2
> 
>

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 6abb0e2..84c7611 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -352,8 +352,8 @@  static void pci_init_wmask(PCIDevice *dev)
     int i;
     dev->wmask[PCI_CACHE_LINE_SIZE] = 0xff;
     dev->wmask[PCI_INTERRUPT_LINE] = 0xff;
-    dev->wmask[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY
-                              | PCI_COMMAND_MASTER;
+    pci_set_word(dev->wmask + PCI_COMMAND,
+                 PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
     for (i = PCI_CONFIG_HEADER_SIZE; i < PCI_CONFIG_SPACE_SIZE; ++i)
         dev->wmask[i] = 0xff;
 }