diff options
author | Burman Yan <yan_952@hotmail.com> | 2006-12-06 20:14:13 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:13 -0500 |
commit | 9cfa5b5dfafcfe64c1a48906f243cdd302f82471 (patch) | |
tree | ae9c4ca7664f8474f40f47b1d76e5213c3f5ed3a /arch | |
parent | d5d2448d896fbb9a427ee12eb8e5f6309f2473f7 (diff) |
[PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/if.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/main.c | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/i386/kernel/cpu/mtrr/if.c index 9753bc6a1f3f..5ae1705eafa6 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/i386/kernel/cpu/mtrr/if.c | |||
@@ -44,10 +44,9 @@ mtrr_file_add(unsigned long base, unsigned long size, | |||
44 | 44 | ||
45 | max = num_var_ranges; | 45 | max = num_var_ranges; |
46 | if (fcount == NULL) { | 46 | if (fcount == NULL) { |
47 | fcount = kmalloc(max * sizeof *fcount, GFP_KERNEL); | 47 | fcount = kzalloc(max * sizeof *fcount, GFP_KERNEL); |
48 | if (!fcount) | 48 | if (!fcount) |
49 | return -ENOMEM; | 49 | return -ENOMEM; |
50 | memset(fcount, 0, max * sizeof *fcount); | ||
51 | FILE_FCOUNT(file) = fcount; | 50 | FILE_FCOUNT(file) = fcount; |
52 | } | 51 | } |
53 | if (!page) { | 52 | if (!page) { |
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c index aeea23e8a050..16bb7ea87145 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/i386/kernel/cpu/mtrr/main.c | |||
@@ -596,10 +596,8 @@ static int mtrr_save(struct sys_device * sysdev, pm_message_t state) | |||
596 | int i; | 596 | int i; |
597 | int size = num_var_ranges * sizeof(struct mtrr_value); | 597 | int size = num_var_ranges * sizeof(struct mtrr_value); |
598 | 598 | ||
599 | mtrr_state = kmalloc(size,GFP_ATOMIC); | 599 | mtrr_state = kzalloc(size,GFP_ATOMIC); |
600 | if (mtrr_state) | 600 | if (!mtrr_state) |
601 | memset(mtrr_state,0,size); | ||
602 | else | ||
603 | return -ENOMEM; | 601 | return -ENOMEM; |
604 | 602 | ||
605 | for (i = 0; i < num_var_ranges; i++) { | 603 | for (i = 0; i < num_var_ranges; i++) { |