mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
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>
This commit is contained in:
parent
5dc8bff0f6
commit
0906372e6c
1 changed files with 4 additions and 14 deletions
|
@ -1042,20 +1042,10 @@ static int __init parse_amd_iommu_options(char *str)
|
||||||
|
|
||||||
static int __init parse_amd_iommu_size_options(char *str)
|
static int __init parse_amd_iommu_size_options(char *str)
|
||||||
{
|
{
|
||||||
for (; *str; ++str) {
|
unsigned order = PAGE_SHIFT + get_order(memparse(str, &str));
|
||||||
if (strcmp(str, "32M") == 0)
|
|
||||||
amd_iommu_aperture_order = 25;
|
if ((order > 24) && (order < 31))
|
||||||
if (strcmp(str, "64M") == 0)
|
amd_iommu_aperture_order = order;
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue