Skip to content

Commit b146ada

Browse files
rppttorvalds
authored andcommitted
mm: nobootmem: remove dead code
Several bootmem functions and macros are not used. Remove them. Link: http://lkml.kernel.org/r/1536927045-23536-6-git-send-email-rppt@linux.vnet.ibm.com Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Acked-by: Michal Hocko <mhocko@suse.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Chris Zankel <chris@zankel.net> Cc: "David S. Miller" <davem@davemloft.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greentime Hu <green.hu@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Guan Xuetao <gxt@pku.edu.cn> Cc: Ingo Molnar <mingo@redhat.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Jonas Bonn <jonas@southpole.se> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Ley Foon Tan <lftan@altera.com> Cc: Mark Salter <msalter@redhat.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Matt Turner <mattst88@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Simek <monstr@monstr.eu> Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Paul Burton <paul.burton@mips.com> Cc: Richard Kuo <rkuo@codeaurora.org> Cc: Richard Weinberger <richard@nod.at> Cc: Rich Felker <dalias@libc.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Serge Semin <fancer.lancer@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 355c45a commit b146ada

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

include/linux/bootmem.h

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ extern void free_bootmem_node(pg_data_t *pgdat,
3636
extern void free_bootmem(unsigned long physaddr, unsigned long size);
3737
extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
3838

39-
/*
40-
* Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
41-
* the architecture-specific code should honor this).
42-
*
43-
* If flags is BOOTMEM_DEFAULT, then the return value is always 0 (success).
44-
* If flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the memory
45-
* already was reserved.
46-
*/
47-
#define BOOTMEM_DEFAULT 0
48-
#define BOOTMEM_EXCLUSIVE (1<<0)
49-
5039
extern void *__alloc_bootmem(unsigned long size,
5140
unsigned long align,
5241
unsigned long goal);
@@ -73,13 +62,6 @@ void *___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
7362
extern void *__alloc_bootmem_low(unsigned long size,
7463
unsigned long align,
7564
unsigned long goal) __malloc;
76-
void *__alloc_bootmem_low_nopanic(unsigned long size,
77-
unsigned long align,
78-
unsigned long goal) __malloc;
79-
extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
80-
unsigned long size,
81-
unsigned long align,
82-
unsigned long goal) __malloc;
8365

8466
/* We are using top down, so it is safe to use 0 here */
8567
#define BOOTMEM_LOW_LIMIT 0
@@ -92,8 +74,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
9274
__alloc_bootmem(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
9375
#define alloc_bootmem_align(x, align) \
9476
__alloc_bootmem(x, align, BOOTMEM_LOW_LIMIT)
95-
#define alloc_bootmem_nopanic(x) \
96-
__alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
9777
#define alloc_bootmem_pages(x) \
9878
__alloc_bootmem(x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
9979
#define alloc_bootmem_pages_nopanic(x) \
@@ -104,17 +84,11 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
10484
__alloc_bootmem_node_nopanic(pgdat, x, SMP_CACHE_BYTES, BOOTMEM_LOW_LIMIT)
10585
#define alloc_bootmem_pages_node(pgdat, x) \
10686
__alloc_bootmem_node(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
107-
#define alloc_bootmem_pages_node_nopanic(pgdat, x) \
108-
__alloc_bootmem_node_nopanic(pgdat, x, PAGE_SIZE, BOOTMEM_LOW_LIMIT)
10987

11088
#define alloc_bootmem_low(x) \
11189
__alloc_bootmem_low(x, SMP_CACHE_BYTES, 0)
112-
#define alloc_bootmem_low_pages_nopanic(x) \
113-
__alloc_bootmem_low_nopanic(x, PAGE_SIZE, 0)
11490
#define alloc_bootmem_low_pages(x) \
11591
__alloc_bootmem_low(x, PAGE_SIZE, 0)
116-
#define alloc_bootmem_low_pages_node(pgdat, x) \
117-
__alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
11892

11993
/* FIXME: use MEMBLOCK_ALLOC_* variants here */
12094
#define BOOTMEM_ALLOC_ACCESSIBLE 0

mm/nobootmem.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -404,38 +404,3 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
404404
{
405405
return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
406406
}
407-
408-
void * __init __alloc_bootmem_low_nopanic(unsigned long size,
409-
unsigned long align,
410-
unsigned long goal)
411-
{
412-
return ___alloc_bootmem_nopanic(size, align, goal,
413-
ARCH_LOW_ADDRESS_LIMIT);
414-
}
415-
416-
/**
417-
* __alloc_bootmem_low_node - allocate low boot memory from a specific node
418-
* @pgdat: node to allocate from
419-
* @size: size of the request in bytes
420-
* @align: alignment of the region
421-
* @goal: preferred starting address of the region
422-
*
423-
* The goal is dropped if it can not be satisfied and the allocation will
424-
* fall back to memory below @goal.
425-
*
426-
* Allocation may fall back to any node in the system if the specified node
427-
* can not hold the requested memory.
428-
*
429-
* The function panics if the request can not be satisfied.
430-
*
431-
* Return: address of the allocated region.
432-
*/
433-
void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size,
434-
unsigned long align, unsigned long goal)
435-
{
436-
if (WARN_ON_ONCE(slab_is_available()))
437-
return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id);
438-
439-
return ___alloc_bootmem_node(pgdat, size, align, goal,
440-
ARCH_LOW_ADDRESS_LIMIT);
441-
}

0 commit comments

Comments
 (0)