]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] x86-64: replace kmalloc+memset with kzalloc in MTRR code
authorBurman Yan <yan_952@hotmail.com>
Thu, 7 Dec 2006 01:14:13 +0000 (02:14 +0100)
committerAndi Kleen <andi@basil.nowhere.org>
Thu, 7 Dec 2006 01:14:13 +0000 (02:14 +0100)
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Andi Kleen <ak@suse.de>
arch/i386/kernel/cpu/mtrr/if.c
arch/i386/kernel/cpu/mtrr/main.c

index 9753bc6a1f3fa2b9131c92a903893d686029538b..5ae1705eafa6281adcfc065702a0d2743575d5e2 100644 (file)
@@ -44,10 +44,9 @@ mtrr_file_add(unsigned long base, unsigned long size,
 
        max = num_var_ranges;
        if (fcount == NULL) {
-               fcount = kmalloc(max * sizeof *fcount, GFP_KERNEL);
+               fcount = kzalloc(max * sizeof *fcount, GFP_KERNEL);
                if (!fcount)
                        return -ENOMEM;
-               memset(fcount, 0, max * sizeof *fcount);
                FILE_FCOUNT(file) = fcount;
        }
        if (!page) {
index aeea23e8a05029e915998f0a8b0adfd204c088d9..16bb7ea87145411e9ee63f1dd31b982a4f7ed816 100644 (file)
@@ -596,10 +596,8 @@ static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
        int i;
        int size = num_var_ranges * sizeof(struct mtrr_value);
 
-       mtrr_state = kmalloc(size,GFP_ATOMIC);
-       if (mtrr_state)
-               memset(mtrr_state,0,size);
-       else
+       mtrr_state = kzalloc(size,GFP_ATOMIC);
+       if (!mtrr_state)
                return -ENOMEM;
 
        for (i = 0; i < num_var_ranges; i++) {