aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-07-11 11:14:33 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-11 12:01:16 -0400
commit0906372e6cf372f3162481f24a0b8ccae0eff4d7 (patch)
treeea6e3ddbe3654d4342a2303cdbd4de7323d1c087 /arch/x86/kernel/amd_iommu_init.c
parent5dc8bff0f6d0dfeb1f1c6e694294ba7c33d099f1 (diff)
x86, 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@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.c18
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 2efc3d59b7e6..e0ff9404e6c9 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)
1042 1042
1043static int __init parse_amd_iommu_size_options(char *str) 1043static int __init parse_amd_iommu_size_options(char *str)
1044{ 1044{
1045 for (; *str; ++str) { 1045 unsigned order = PAGE_SHIFT + get_order(memparse(str, &str));
1046 if (strcmp(str, "32M") == 0) 1046
1047 amd_iommu_aperture_order = 25; 1047 if ((order > 24) && (order < 31))
1048 if (strcmp(str, "64M") == 0) 1048 amd_iommu_aperture_order = order;
1049 amd_iommu_aperture_order = 26;
1050 if (strcmp(str, "128M") == 0)
1051 amd_iommu_aperture_order = 27;
1052 if (strcmp(str, "256M") == 0)
1053 amd_iommu_aperture_order = 28;
1054 if (strcmp(str, "512M") == 0)
1055 amd_iommu_aperture_order = 29;
1056 if (strcmp(str, "1G") == 0)
1057 amd_iommu_aperture_order = 30;
1058 }
1059 1049
1060 return 1; 1050 return 1;
1061} 1051}