arch: don't memset(0) memory returned by memblock_alloc()
authorMike Rapoport <[email protected]>
Tue, 12 Mar 2019 06:29:56 +0000 (23:29 -0700)
committerLinus Torvalds <[email protected]>
Tue, 12 Mar 2019 17:04:01 +0000 (10:04 -0700)
memblock_alloc() already clears the allocated memory, no point in doing
it twice.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]> [m68k]
Cc: Catalin Marinas <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Dennis Zhou <[email protected]>
Cc: Greentime Hu <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Guan Xuetao <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Guo Ren <[email protected]> [c-sky]
Cc: Heiko Carstens <[email protected]>
Cc: Juergen Gross <[email protected]> [Xen]
Cc: Mark Salter <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Max Filippov <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Petr Mladek <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Russell King <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
arch/c6x/mm/init.c
arch/h8300/mm/init.c
arch/ia64/kernel/mca.c
arch/m68k/mm/mcfmmu.c
arch/microblaze/mm/init.c
arch/sparc/kernel/prom_32.c

index af5ada0520bea716b306209448e3235deb830ac6..e83c0465423847198919ff9612ee3586c14ce244 100644 (file)
@@ -40,7 +40,6 @@ void __init paging_init(void)
 
        empty_zero_page      = (unsigned long) memblock_alloc(PAGE_SIZE,
                                                              PAGE_SIZE);
-       memset((void *)empty_zero_page, 0, PAGE_SIZE);
 
        /*
         * Set up user data space
index 6519252ac4dbd7669ca5ebc95930e91773d4f397..a1578904ad4e765d111ac742bc762fb7d46f77b0 100644 (file)
@@ -68,7 +68,6 @@ void __init paging_init(void)
         * to a couple of allocated pages.
         */
        empty_zero_page = (unsigned long)memblock_alloc(PAGE_SIZE, PAGE_SIZE);
-       memset((void *)empty_zero_page, 0, PAGE_SIZE);
 
        /*
         * Set up SFC/DFC registers (user data space).
index 74d148bd48765ea5e0cf70678748a0b89fc65888..370bc349619a36bdd40f14a07e5eae2d615fcb5a 100644 (file)
@@ -400,8 +400,6 @@ ia64_log_init(int sal_info_type)
 
        // set up OS data structures to hold error info
        IA64_LOG_ALLOCATE(sal_info_type, max_size);
-       memset(IA64_LOG_CURR_BUFFER(sal_info_type), 0, max_size);
-       memset(IA64_LOG_NEXT_BUFFER(sal_info_type), 0, max_size);
 }
 
 /*
index 0de4999a3810db9441b44251da67d537af90f682..492f953db31bf6359c77a691c1d46a02907add94 100644 (file)
@@ -44,7 +44,6 @@ void __init paging_init(void)
        int i;
 
        empty_zero_page = (void *) memblock_alloc(PAGE_SIZE, PAGE_SIZE);
-       memset((void *) empty_zero_page, 0, PAGE_SIZE);
 
        pg_dir = swapper_pg_dir;
        memset(swapper_pg_dir, 0, sizeof(swapper_pg_dir));
index 44f4b8910c2140a7025022f10969a70266a45e59..bd1cd4bff449998a9bc233942cb4d41c9f6ce3e8 100644 (file)
@@ -376,10 +376,8 @@ void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
 
        if (mem_init_done)
                p = kzalloc(size, mask);
-       else {
+       else
                p = memblock_alloc(size, SMP_CACHE_BYTES);
-               if (p)
-                       memset(p, 0, size);
-       }
+
        return p;
 }
index 38940afaa696537f29c4d29d06934b033e30fab7..e7126ca4ead7c570728af37f8d94bb43e5d6c047 100644 (file)
@@ -33,8 +33,6 @@ void * __init prom_early_alloc(unsigned long size)
        void *ret;
 
        ret = memblock_alloc(size, SMP_CACHE_BYTES);
-       if (ret != NULL)
-               memset(ret, 0, size);
 
        prom_early_allocated += size;