提交 af54f12a 编写于 作者: M Mike Rapoport 提交者: Xie XiuQi

memblock: replace usage of __memblock_free_early() with memblock_free()

mainline inclusion
from mainline-v5.0-rc1
commit 4d72868c8f7c293fc8408a54db4e0a12dc031152
category: bugfix
bugzilla: 23287
CVE: NA

-------------------------------------------------

__memblock_free_early() is only used by the convenience wrappers, so
essentially we wrap a call to memblock_free() twice.  Replace calls of
__memblock_free_early() with calls to memblock_free() and drop the former.

Link: http://lkml.kernel.org/r/20181125102940.GE28634@rapoport-lnxSigned-off-by: NMike Rapoport <rppt@linux.ibm.com>
Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
Cc: Wentao Wang <witallwang@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NChenwandun <chenwandun@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5f9ae0cc
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/mm_types.h> #include <linux/mm_types.h>
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <linux/memblock.h>
/* /*
* simple boot-time physical memory area allocator. * simple boot-time physical memory area allocator.
...@@ -251,13 +252,13 @@ static inline void * __init memblock_virt_alloc_node_nopanic( ...@@ -251,13 +252,13 @@ static inline void * __init memblock_virt_alloc_node_nopanic(
static inline void __init memblock_free_early( static inline void __init memblock_free_early(
phys_addr_t base, phys_addr_t size) phys_addr_t base, phys_addr_t size)
{ {
__memblock_free_early(base, size); memblock_free(base, size);
} }
static inline void __init memblock_free_early_nid( static inline void __init memblock_free_early_nid(
phys_addr_t base, phys_addr_t size, int nid) phys_addr_t base, phys_addr_t size, int nid)
{ {
__memblock_free_early(base, size); memblock_free(base, size);
} }
static inline void __init memblock_free_late( static inline void __init memblock_free_late(
......
...@@ -138,7 +138,6 @@ void __next_mem_range_rev(u64 *idx, int nid, enum memblock_flags flags, ...@@ -138,7 +138,6 @@ void __next_mem_range_rev(u64 *idx, int nid, enum memblock_flags flags,
void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start, void __next_reserved_mem_region(u64 *idx, phys_addr_t *out_start,
phys_addr_t *out_end); phys_addr_t *out_end);
void __memblock_free_early(phys_addr_t base, phys_addr_t size);
void __memblock_free_late(phys_addr_t base, phys_addr_t size); void __memblock_free_late(phys_addr_t base, phys_addr_t size);
/** /**
......
...@@ -792,7 +792,14 @@ int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size) ...@@ -792,7 +792,14 @@ int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
return memblock_remove_range(&memblock.memory, base, size); return memblock_remove_range(&memblock.memory, base, size);
} }
/**
* memblock_free - free boot memory block
* @base: phys starting address of the boot memory block
* @size: size of the boot memory block in bytes
*
* Free boot memory block previously allocated by memblock_alloc_xx() API.
* The freeing memory will not be released to the buddy allocator.
*/
int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
{ {
phys_addr_t end = base + size - 1; phys_addr_t end = base + size - 1;
...@@ -1585,19 +1592,6 @@ void * __init memblock_virt_alloc_try_nid( ...@@ -1585,19 +1592,6 @@ void * __init memblock_virt_alloc_try_nid(
} }
#endif #endif
/**
* __memblock_free_early - free boot memory block
* @base: phys starting address of the boot memory block
* @size: size of the boot memory block in bytes
*
* Free boot memory block previously allocated by memblock_virt_alloc_xx() API.
* The freeing memory will not be released to the buddy allocator.
*/
void __init __memblock_free_early(phys_addr_t base, phys_addr_t size)
{
memblock_free(base, size);
}
/** /**
* __memblock_free_late - free bootmem block pages directly to buddy allocator * __memblock_free_late - free bootmem block pages directly to buddy allocator
* @base: phys starting address of the boot memory block * @base: phys starting address of the boot memory block
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册