diff options
author | Mike Rapoport <rppt@linux.vnet.ibm.com> | 2018-06-30 10:55:01 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2018-08-02 14:17:27 -0400 |
commit | e1720fee27246dfb84f7c433e35367170a2d4436 (patch) | |
tree | 692ff63348b891ca6eea2052f79f60ed1576b7e6 /mm/memblock.c | |
parent | 58faef9328f7d66b377cb34a20331c4310cdbd5e (diff) |
mm/memblock: add a name for memblock flags enumeration
Since kernel-doc does not like anonymous enums the name is required for
adding documentation. While on it, I've also updated all the function
declarations to use 'enum memblock_flags' instead of unsigned long.
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r-- | mm/memblock.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 03d48d8835ba..20f48b49821a 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -60,7 +60,7 @@ static int memblock_can_resize __initdata_memblock; | |||
60 | static int memblock_memory_in_slab __initdata_memblock = 0; | 60 | static int memblock_memory_in_slab __initdata_memblock = 0; |
61 | static int memblock_reserved_in_slab __initdata_memblock = 0; | 61 | static int memblock_reserved_in_slab __initdata_memblock = 0; |
62 | 62 | ||
63 | ulong __init_memblock choose_memblock_flags(void) | 63 | enum memblock_flags __init_memblock choose_memblock_flags(void) |
64 | { | 64 | { |
65 | return system_has_some_mirror ? MEMBLOCK_MIRROR : MEMBLOCK_NONE; | 65 | return system_has_some_mirror ? MEMBLOCK_MIRROR : MEMBLOCK_NONE; |
66 | } | 66 | } |
@@ -109,7 +109,7 @@ bool __init_memblock memblock_overlaps_region(struct memblock_type *type, | |||
109 | static phys_addr_t __init_memblock | 109 | static phys_addr_t __init_memblock |
110 | __memblock_find_range_bottom_up(phys_addr_t start, phys_addr_t end, | 110 | __memblock_find_range_bottom_up(phys_addr_t start, phys_addr_t end, |
111 | phys_addr_t size, phys_addr_t align, int nid, | 111 | phys_addr_t size, phys_addr_t align, int nid, |
112 | ulong flags) | 112 | enum memblock_flags flags) |
113 | { | 113 | { |
114 | phys_addr_t this_start, this_end, cand; | 114 | phys_addr_t this_start, this_end, cand; |
115 | u64 i; | 115 | u64 i; |
@@ -143,7 +143,7 @@ __memblock_find_range_bottom_up(phys_addr_t start, phys_addr_t end, | |||
143 | static phys_addr_t __init_memblock | 143 | static phys_addr_t __init_memblock |
144 | __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, | 144 | __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, |
145 | phys_addr_t size, phys_addr_t align, int nid, | 145 | phys_addr_t size, phys_addr_t align, int nid, |
146 | ulong flags) | 146 | enum memblock_flags flags) |
147 | { | 147 | { |
148 | phys_addr_t this_start, this_end, cand; | 148 | phys_addr_t this_start, this_end, cand; |
149 | u64 i; | 149 | u64 i; |
@@ -188,7 +188,8 @@ __memblock_find_range_top_down(phys_addr_t start, phys_addr_t end, | |||
188 | */ | 188 | */ |
189 | phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, | 189 | phys_addr_t __init_memblock memblock_find_in_range_node(phys_addr_t size, |
190 | phys_addr_t align, phys_addr_t start, | 190 | phys_addr_t align, phys_addr_t start, |
191 | phys_addr_t end, int nid, ulong flags) | 191 | phys_addr_t end, int nid, |
192 | enum memblock_flags flags) | ||
192 | { | 193 | { |
193 | phys_addr_t kernel_end, ret; | 194 | phys_addr_t kernel_end, ret; |
194 | 195 | ||
@@ -251,7 +252,7 @@ phys_addr_t __init_memblock memblock_find_in_range(phys_addr_t start, | |||
251 | phys_addr_t align) | 252 | phys_addr_t align) |
252 | { | 253 | { |
253 | phys_addr_t ret; | 254 | phys_addr_t ret; |
254 | ulong flags = choose_memblock_flags(); | 255 | enum memblock_flags flags = choose_memblock_flags(); |
255 | 256 | ||
256 | again: | 257 | again: |
257 | ret = memblock_find_in_range_node(size, align, start, end, | 258 | ret = memblock_find_in_range_node(size, align, start, end, |
@@ -472,7 +473,8 @@ static void __init_memblock memblock_merge_regions(struct memblock_type *type) | |||
472 | static void __init_memblock memblock_insert_region(struct memblock_type *type, | 473 | static void __init_memblock memblock_insert_region(struct memblock_type *type, |
473 | int idx, phys_addr_t base, | 474 | int idx, phys_addr_t base, |
474 | phys_addr_t size, | 475 | phys_addr_t size, |
475 | int nid, unsigned long flags) | 476 | int nid, |
477 | enum memblock_flags flags) | ||
476 | { | 478 | { |
477 | struct memblock_region *rgn = &type->regions[idx]; | 479 | struct memblock_region *rgn = &type->regions[idx]; |
478 | 480 | ||
@@ -504,7 +506,7 @@ static void __init_memblock memblock_insert_region(struct memblock_type *type, | |||
504 | */ | 506 | */ |
505 | int __init_memblock memblock_add_range(struct memblock_type *type, | 507 | int __init_memblock memblock_add_range(struct memblock_type *type, |
506 | phys_addr_t base, phys_addr_t size, | 508 | phys_addr_t base, phys_addr_t size, |
507 | int nid, unsigned long flags) | 509 | int nid, enum memblock_flags flags) |
508 | { | 510 | { |
509 | bool insert = false; | 511 | bool insert = false; |
510 | phys_addr_t obase = base; | 512 | phys_addr_t obase = base; |
@@ -873,7 +875,8 @@ void __init_memblock __next_reserved_mem_region(u64 *idx, | |||
873 | * As both region arrays are sorted, the function advances the two indices | 875 | * As both region arrays are sorted, the function advances the two indices |
874 | * in lockstep and returns each intersection. | 876 | * in lockstep and returns each intersection. |
875 | */ | 877 | */ |
876 | void __init_memblock __next_mem_range(u64 *idx, int nid, ulong flags, | 878 | void __init_memblock __next_mem_range(u64 *idx, int nid, |
879 | enum memblock_flags flags, | ||
877 | struct memblock_type *type_a, | 880 | struct memblock_type *type_a, |
878 | struct memblock_type *type_b, | 881 | struct memblock_type *type_b, |
879 | phys_addr_t *out_start, | 882 | phys_addr_t *out_start, |
@@ -982,7 +985,8 @@ void __init_memblock __next_mem_range(u64 *idx, int nid, ulong flags, | |||
982 | * | 985 | * |
983 | * Reverse of __next_mem_range(). | 986 | * Reverse of __next_mem_range(). |
984 | */ | 987 | */ |
985 | void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags, | 988 | void __init_memblock __next_mem_range_rev(u64 *idx, int nid, |
989 | enum memblock_flags flags, | ||
986 | struct memblock_type *type_a, | 990 | struct memblock_type *type_a, |
987 | struct memblock_type *type_b, | 991 | struct memblock_type *type_b, |
988 | phys_addr_t *out_start, | 992 | phys_addr_t *out_start, |
@@ -1140,7 +1144,8 @@ int __init_memblock memblock_set_node(phys_addr_t base, phys_addr_t size, | |||
1140 | 1144 | ||
1141 | static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, | 1145 | static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, |
1142 | phys_addr_t align, phys_addr_t start, | 1146 | phys_addr_t align, phys_addr_t start, |
1143 | phys_addr_t end, int nid, ulong flags) | 1147 | phys_addr_t end, int nid, |
1148 | enum memblock_flags flags) | ||
1144 | { | 1149 | { |
1145 | phys_addr_t found; | 1150 | phys_addr_t found; |
1146 | 1151 | ||
@@ -1162,7 +1167,7 @@ static phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, | |||
1162 | 1167 | ||
1163 | phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, | 1168 | phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, |
1164 | phys_addr_t start, phys_addr_t end, | 1169 | phys_addr_t start, phys_addr_t end, |
1165 | ulong flags) | 1170 | enum memblock_flags flags) |
1166 | { | 1171 | { |
1167 | return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, | 1172 | return memblock_alloc_range_nid(size, align, start, end, NUMA_NO_NODE, |
1168 | flags); | 1173 | flags); |
@@ -1170,14 +1175,14 @@ phys_addr_t __init memblock_alloc_range(phys_addr_t size, phys_addr_t align, | |||
1170 | 1175 | ||
1171 | phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, | 1176 | phys_addr_t __init memblock_alloc_base_nid(phys_addr_t size, |
1172 | phys_addr_t align, phys_addr_t max_addr, | 1177 | phys_addr_t align, phys_addr_t max_addr, |
1173 | int nid, ulong flags) | 1178 | int nid, enum memblock_flags flags) |
1174 | { | 1179 | { |
1175 | return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags); | 1180 | return memblock_alloc_range_nid(size, align, 0, max_addr, nid, flags); |
1176 | } | 1181 | } |
1177 | 1182 | ||
1178 | phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid) | 1183 | phys_addr_t __init memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid) |
1179 | { | 1184 | { |
1180 | ulong flags = choose_memblock_flags(); | 1185 | enum memblock_flags flags = choose_memblock_flags(); |
1181 | phys_addr_t ret; | 1186 | phys_addr_t ret; |
1182 | 1187 | ||
1183 | again: | 1188 | again: |
@@ -1258,7 +1263,7 @@ static void * __init memblock_virt_alloc_internal( | |||
1258 | { | 1263 | { |
1259 | phys_addr_t alloc; | 1264 | phys_addr_t alloc; |
1260 | void *ptr; | 1265 | void *ptr; |
1261 | ulong flags = choose_memblock_flags(); | 1266 | enum memblock_flags flags = choose_memblock_flags(); |
1262 | 1267 | ||
1263 | if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n")) | 1268 | if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n")) |
1264 | nid = NUMA_NO_NODE; | 1269 | nid = NUMA_NO_NODE; |
@@ -1733,7 +1738,7 @@ phys_addr_t __init_memblock memblock_get_current_limit(void) | |||
1733 | static void __init_memblock memblock_dump(struct memblock_type *type) | 1738 | static void __init_memblock memblock_dump(struct memblock_type *type) |
1734 | { | 1739 | { |
1735 | phys_addr_t base, end, size; | 1740 | phys_addr_t base, end, size; |
1736 | unsigned long flags; | 1741 | enum memblock_flags flags; |
1737 | int idx; | 1742 | int idx; |
1738 | struct memblock_region *rgn; | 1743 | struct memblock_region *rgn; |
1739 | 1744 | ||
@@ -1751,7 +1756,7 @@ static void __init_memblock memblock_dump(struct memblock_type *type) | |||
1751 | snprintf(nid_buf, sizeof(nid_buf), " on node %d", | 1756 | snprintf(nid_buf, sizeof(nid_buf), " on node %d", |
1752 | memblock_get_region_node(rgn)); | 1757 | memblock_get_region_node(rgn)); |
1753 | #endif | 1758 | #endif |
1754 | pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#lx\n", | 1759 | pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#x\n", |
1755 | type->name, idx, &base, &end, &size, nid_buf, flags); | 1760 | type->name, idx, &base, &end, &size, nid_buf, flags); |
1756 | } | 1761 | } |
1757 | } | 1762 | } |