diff mbox

[v2,4/5] pci: use PCI_SLOT in pci_get_bus_devfn()

Message ID bd7f33e8c88e87971f4eaeacf4432729f53e86c5.1296111201.git.yamahata@valinux.co.jp
State New
Headers show

Commit Message

Isaku Yamahata Jan. 27, 2011, 6:56 a.m. UTC
use PCI_SLOT in pci_get_bus_devfn().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Michael S. Tsirkin Jan. 27, 2011, 7:31 a.m. UTC | #1
On Thu, Jan 27, 2011 at 03:56:38PM +0900, Isaku Yamahata wrote:
> use PCI_SLOT in pci_get_bus_devfn().
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Tweaked the comment and applied.

> ---
>  hw/pci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 471d4d7..e25bf7a 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -558,7 +558,7 @@ PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
>          return NULL;
>      }
>  
> -    *devfnp = slot << 3;
> +    *devfnp = PCI_DEVFN(slot, 0);
>      return pci_find_bus(pci_find_root_bus(dom), bus);
>  }
>  
> -- 
> 1.7.1.1
diff mbox

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 471d4d7..e25bf7a 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -558,7 +558,7 @@  PCIBus *pci_get_bus_devfn(int *devfnp, const char *devaddr)
         return NULL;
     }
 
-    *devfnp = slot << 3;
+    *devfnp = PCI_DEVFN(slot, 0);
     return pci_find_bus(pci_find_root_bus(dom), bus);
 }