[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1215789275-20975-15-git-send-email-joerg.roedel@amd.com>
Date: Fri, 11 Jul 2008 17:14:33 +0200
From: Joerg Roedel <joerg.roedel@....com>
To: mingo@...hat.com, tglx@...utronix.de
CC: linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
bhavna.sarathy@....com, robert.richter@....com,
Joerg Roedel <joerg.roedel@....com>
Subject: [PATCH 14/16] AMD IOMMU: replace self made size parsing with memparse call
This patch replaces the self-made parsing of the amd_iommu_size option with the
generic memparse function call.
Signed-off-by: Joerg Roedel <joerg.roedel@....com>
---
arch/x86/kernel/amd_iommu_init.c | 18 ++++--------------
1 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 2efc3d5..e0ff940 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1042,20 +1042,10 @@ static int __init parse_amd_iommu_options(char *str)
static int __init parse_amd_iommu_size_options(char *str)
{
- for (; *str; ++str) {
- if (strcmp(str, "32M") == 0)
- amd_iommu_aperture_order = 25;
- if (strcmp(str, "64M") == 0)
- amd_iommu_aperture_order = 26;
- if (strcmp(str, "128M") == 0)
- amd_iommu_aperture_order = 27;
- if (strcmp(str, "256M") == 0)
- amd_iommu_aperture_order = 28;
- if (strcmp(str, "512M") == 0)
- amd_iommu_aperture_order = 29;
- if (strcmp(str, "1G") == 0)
- amd_iommu_aperture_order = 30;
- }
+ unsigned order = PAGE_SHIFT + get_order(memparse(str, &str));
+
+ if ((order > 24) && (order < 31))
+ amd_iommu_aperture_order = order;
return 1;
}
--
1.5.3.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists