mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: mingo@redhat.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	bhavna.sarathy@amd.com, robert.richter@amd.com,
	Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 05/16] AMD IOMMU: replace UPDATE_LAST_BDF macro with a function
Date: Fri, 11 Jul 2008 17:14:24 +0200	[thread overview]
Message-ID: <1215789275-20975-6-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1215789275-20975-1-git-send-email-joerg.roedel@amd.com>

This patch replaces the UPDATE_LAST_BDF macro in the init code with the
update_last_devid function.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 arch/x86/kernel/amd_iommu_init.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 9ddb46d..6e1c8ff 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -30,11 +30,6 @@
 /*
  * definitions for the ACPI scanning code
  */
-#define UPDATE_LAST_BDF(x) do {\
-	if ((x) > amd_iommu_last_bdf) \
-		amd_iommu_last_bdf = (x); \
-	} while (0);
-
 #define DEVID(bus, devfn) (((bus) << 8) | (devfn))
 #define PCI_BUS(x) (((x) >> 8) & 0xff)
 #define IVRS_HEADER_LENGTH 48
@@ -169,6 +164,12 @@ static u32 dev_table_size;	/* size of the device table */
 static u32 alias_table_size;	/* size of the alias table */
 static u32 rlookup_table_size;	/* size if the rlookup table */
 
+static inline void update_last_devid(u16 devid)
+{
+	if (devid > amd_iommu_last_bdf)
+		amd_iommu_last_bdf = devid;
+}
+
 /****************************************************************************
  *
  * AMD IOMMU MMIO register space handling functions
@@ -287,7 +288,7 @@ static int __init find_last_devid_on_pci(int bus, int dev, int fn, int cap_ptr)
 	u32 cap;
 
 	cap = read_pci_config(bus, dev, fn, cap_ptr+MMIO_RANGE_OFFSET);
-	UPDATE_LAST_BDF(DEVID(MMIO_GET_BUS(cap), MMIO_GET_LD(cap)));
+	update_last_devid(DEVID(MMIO_GET_BUS(cap), MMIO_GET_LD(cap)));
 
 	return 0;
 }
@@ -317,7 +318,7 @@ static int __init find_last_devid_from_ivhd(struct ivhd_header *h)
 		case IVHD_DEV_ALIAS:
 		case IVHD_DEV_EXT_SELECT:
 			/* all the above subfield types refer to device ids */
-			UPDATE_LAST_BDF(dev->devid);
+			update_last_devid(dev->devid);
 			break;
 		default:
 			break;
-- 
1.5.3.7



  parent reply	other threads:[~2008-07-11 15:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 15:14 [PATCH 0/16] AMD IOMMU updates Joerg Roedel
2008-07-11 15:14 ` [PATCH 01/16] AMD IOMMU: add comments to amd_iommu_types.h Joerg Roedel
2008-07-11 15:14 ` [PATCH 02/16] AMD IOMMU: add comments to the initialization code Joerg Roedel
2008-07-11 15:14 ` [PATCH 03/16] AMD IOMMU: add comments to core code Joerg Roedel
2008-07-11 15:14 ` [PATCH 04/16] AMD IOMMU: replace HIGH_U32 macro with upper_32_bits function Joerg Roedel
2008-07-11 15:14 ` Joerg Roedel [this message]
2008-07-11 15:14 ` [PATCH 06/16] AMD IOMMU: replace TBL_SIZE macro with a function Joerg Roedel
2008-07-11 15:14 ` [PATCH 07/16] AMD IOMMU: remove unnecessary free checks from init code Joerg Roedel
2008-07-11 15:14 ` [PATCH 08/16] AMD IOMMU: add an emergency exit to the completion wait loop Joerg Roedel
2008-07-11 15:14 ` [PATCH 09/16] AMD IOMMU: rename struct command to iommu_cmd Joerg Roedel
2008-07-11 15:14 ` [PATCH 10/16] AMD IOMMU: remove unneeded initializations from command buffer allocation Joerg Roedel
2008-07-11 15:14 ` [PATCH 11/16] AMD IOMMU: use true/false instead of 0/1 for bool value Joerg Roedel
2008-07-11 15:14 ` [PATCH 12/16] AMD IOMMU: do runtime list initialization at compile time Joerg Roedel
2008-07-11 15:14 ` [PATCH 13/16] AMD IOMMU: replace memset with __GFP_ZERO for table allocation Joerg Roedel
2008-07-11 15:14 ` [PATCH 14/16] AMD IOMMU: replace self made size parsing with memparse call Joerg Roedel
2008-07-11 15:14 ` [PATCH 15/16] AMD IOMMU: fix device table entry size Joerg Roedel
2008-07-11 15:14 ` [PATCH 16/16] AMD IOMMU: replace DEVID macro with a function Joerg Roedel
2008-07-11 16:01 ` [PATCH 0/16] AMD IOMMU updates Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1215789275-20975-6-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=bhavna.sarathy@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=robert.richter@amd.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®