diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-07-11 11:14:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-11 12:01:12 -0400 |
commit | 9a836de0c9944c42d006ec241712c72e74737c73 (patch) | |
tree | 3e91e92e5239fc58e308de99498ff44ece8746f7 /arch/x86/kernel/amd_iommu_init.c | |
parent | c571484e53f3e1d90bc5374528580c7419d28d4c (diff) |
x86, AMD IOMMU: remove unnecessary free checks from init code
This patch removes unnecessary checks before memory is released.
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 | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 1f148393cf7a..0f5a9115a694 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -417,9 +417,7 @@ static u8 * __init alloc_command_buffer(struct amd_iommu *iommu) | |||
417 | 417 | ||
418 | static void __init free_command_buffer(struct amd_iommu *iommu) | 418 | static void __init free_command_buffer(struct amd_iommu *iommu) |
419 | { | 419 | { |
420 | if (iommu->cmd_buf) | 420 | free_pages((unsigned long)iommu->cmd_buf, get_order(CMD_BUFFER_SIZE)); |
421 | free_pages((unsigned long)iommu->cmd_buf, | ||
422 | get_order(CMD_BUFFER_SIZE)); | ||
423 | } | 421 | } |
424 | 422 | ||
425 | /* sets a specific bit in the device table entry. */ | 423 | /* sets a specific bit in the device table entry. */ |
@@ -987,24 +985,19 @@ out: | |||
987 | return ret; | 985 | return ret; |
988 | 986 | ||
989 | free: | 987 | free: |
990 | if (amd_iommu_pd_alloc_bitmap) | 988 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1); |
991 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, 1); | ||
992 | 989 | ||
993 | if (amd_iommu_pd_table) | 990 | free_pages((unsigned long)amd_iommu_pd_table, |
994 | free_pages((unsigned long)amd_iommu_pd_table, | 991 | get_order(rlookup_table_size)); |
995 | get_order(rlookup_table_size)); | ||
996 | 992 | ||
997 | if (amd_iommu_rlookup_table) | 993 | free_pages((unsigned long)amd_iommu_rlookup_table, |
998 | free_pages((unsigned long)amd_iommu_rlookup_table, | 994 | get_order(rlookup_table_size)); |
999 | get_order(rlookup_table_size)); | ||
1000 | 995 | ||
1001 | if (amd_iommu_alias_table) | 996 | free_pages((unsigned long)amd_iommu_alias_table, |
1002 | free_pages((unsigned long)amd_iommu_alias_table, | 997 | get_order(alias_table_size)); |
1003 | get_order(alias_table_size)); | ||
1004 | 998 | ||
1005 | if (amd_iommu_dev_table) | 999 | free_pages((unsigned long)amd_iommu_dev_table, |
1006 | free_pages((unsigned long)amd_iommu_dev_table, | 1000 | get_order(dev_table_size)); |
1007 | get_order(dev_table_size)); | ||
1008 | 1001 | ||
1009 | free_iommu_all(); | 1002 | free_iommu_all(); |
1010 | 1003 | ||