diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-07-11 11:14:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-11 12:01:18 -0400 |
commit | d591b0a3ae25f587d0c4da1e1d1a425143590790 (patch) | |
tree | 8a59693815fefc41236e8207774e23a865d04f2e /arch/x86/kernel/amd_iommu_init.c | |
parent | 83f5aac18ccd02170f4a61e7289ceabd5101c1a0 (diff) |
x86, AMD IOMMU: replace DEVID macro with a function
This patch replaces the DEVID macro with a function and uses them where
apropriate (also in the core code).
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: iommu@lists.linux-foundation.org
Cc: bhavna.sarathy@amd.com
Cc: robert.richter@amd.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index e0ff9404e6c9..9bf1b8111b08 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -30,7 +30,6 @@ | |||
30 | /* | 30 | /* |
31 | * definitions for the ACPI scanning code | 31 | * definitions for the ACPI scanning code |
32 | */ | 32 | */ |
33 | #define DEVID(bus, devfn) (((bus) << 8) | (devfn)) | ||
34 | #define PCI_BUS(x) (((x) >> 8) & 0xff) | 33 | #define PCI_BUS(x) (((x) >> 8) & 0xff) |
35 | #define IVRS_HEADER_LENGTH 48 | 34 | #define IVRS_HEADER_LENGTH 48 |
36 | 35 | ||
@@ -295,7 +294,7 @@ static int __init find_last_devid_on_pci(int bus, int dev, int fn, int cap_ptr) | |||
295 | u32 cap; | 294 | u32 cap; |
296 | 295 | ||
297 | cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET); | 296 | cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET); |
298 | update_last_devid(DEVID(MMIO_GET_BUS(cap), MMIO_GET_LD(cap))); | 297 | update_last_devid(calc_devid(MMIO_GET_BUS(cap), MMIO_GET_LD(cap))); |
299 | 298 | ||
300 | return 0; | 299 | return 0; |
301 | } | 300 | } |
@@ -494,8 +493,10 @@ static void __init init_iommu_from_pci(struct amd_iommu *iommu) | |||
494 | iommu->cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_CAP_HDR_OFFSET); | 493 | iommu->cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_CAP_HDR_OFFSET); |
495 | 494 | ||
496 | range = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET); | 495 | range = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET); |
497 | iommu->first_device = DEVID(MMIO_GET_BUS(range), MMIO_GET_FD(range)); | 496 | iommu->first_device = calc_devid(MMIO_GET_BUS(range), |
498 | iommu->last_device = DEVID(MMIO_GET_BUS(range), MMIO_GET_LD(range)); | 497 | MMIO_GET_FD(range)); |
498 | iommu->last_device = calc_devid(MMIO_GET_BUS(range), | ||
499 | MMIO_GET_LD(range)); | ||
499 | } | 500 | } |
500 | 501 | ||
501 | /* | 502 | /* |