memblock: emphasize that memblock_alloc_range() returns a physical address
authorMike Rapoport <[email protected]>
Tue, 12 Mar 2019 06:29:16 +0000 (23:29 -0700)
committerLinus Torvalds <[email protected]>
Tue, 12 Mar 2019 17:04:01 +0000 (10:04 -0700)
Rename memblock_alloc_range() to memblock_phys_alloc_range() to
emphasize that it returns a physical address.

While on it, remove the 'enum memblock_flags' parameter from this
function as its only user anyway sets it to MEMBLOCK_NONE, which is the
default for the most of memblock allocations.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Mike Rapoport <[email protected]>
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: Geert Uytterhoeven <[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]>
include/linux/memblock.h
mm/cma.c
mm/memblock.c

index 4db53f7c6b17e95417221b771311f797233a2f72..251cd66b151b8d1f8f7c6563823d9c4cef2d843c 100644 (file)
@@ -325,6 +325,8 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
 #define ARCH_LOW_ADDRESS_LIMIT  0xffffffffUL
 #endif
 
+phys_addr_t memblock_phys_alloc_range(phys_addr_t size, phys_addr_t align,
+                                     phys_addr_t start, phys_addr_t end);
 phys_addr_t memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);
 phys_addr_t memblock_phys_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid);
 
@@ -443,9 +445,6 @@ static inline bool memblock_bottom_up(void)
        return memblock.bottom_up;
 }
 
-phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align,
-                                       phys_addr_t start, phys_addr_t end,
-                                       enum memblock_flags flags);
 phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
                                phys_addr_t max_addr);
 phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
index f4f3a8a57d8623aa4bdbb71ddb232a33a6493378..bb2d333ffcb3128db361fbe6053818e5db677170 100644 (file)
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -327,16 +327,14 @@ int __init cma_declare_contiguous(phys_addr_t base,
                 * memory in case of failure.
                 */
                if (base < highmem_start && limit > highmem_start) {
-                       addr = memblock_alloc_range(size, alignment,
-                                                   highmem_start, limit,
-                                                   MEMBLOCK_NONE);
+                       addr = memblock_phys_alloc_range(size, alignment,
+                                                        highmem_start, limit);
                        limit = highmem_start;
                }
 
                if (!addr) {
-                       addr = memblock_alloc_range(size, alignment, base,
-                                                   limit,
-                                                   MEMBLOCK_NONE);
+                       addr = memblock_phys_alloc_range(size, alignment, base,
+                                                        limit);
                        if (!addr) {
                                ret = -ENOMEM;
                                goto err;
index e9e440cfd2101f2e8c42cd84acc0a953ba9c2778..eb785ea6757b0b015f7b3afdf1b6f475ff3dac8d 100644 (file)
@@ -1281,12 +1281,13 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size,
        return 0;
 }
 
-phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align,
-                                       phys_addr_t start, phys_addr_t end,
-                                       enum memblock_flags flags)
+phys_addr_t __init memblock_phys_alloc_range(phys_addr_t size,
+                                            phys_addr_t align,
+                                            phys_addr_t start,
+                                            phys_addr_t end)
 {
        return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE,
-                                       flags);
+                                       MEMBLOCK_NONE);
 }
 
 phys_addr_t __init memblock_phys_alloc_nid(phys_addr_t size, phys_addr_t align, int nid)