diff options
author | Tejun Heo <tj@kernel.org> | 2011-12-08 13:22:06 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-12-08 13:22:06 -0500 |
commit | 581adcbe121872429de76ff9884762de71a76200 (patch) | |
tree | 6c7f0faf7ee8812630197e7c23fc32bb4cc978c2 /include/linux/memblock.h | |
parent | 1c16d242aa441c11ccaeaa63b49712555b8bfaeb (diff) |
memblock: Make memblock_{add|remove|free|reserve}() return int and update prototypes
memblock_{add|remove|free|reserve}() return either 0 or -errno but had
long as return type. Chage it to int. Also, drop 'extern' from all
prototypes in memblock.h - they are unnecessary and used
inconsistently (especially if mm.h is included in the picture).
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r-- | include/linux/memblock.h | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index ab89b417655c..2f8e28f859b3 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -52,15 +52,15 @@ phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, | |||
52 | int memblock_free_reserved_regions(void); | 52 | int memblock_free_reserved_regions(void); |
53 | int memblock_reserve_reserved_regions(void); | 53 | int memblock_reserve_reserved_regions(void); |
54 | 54 | ||
55 | extern void memblock_init(void); | 55 | void memblock_init(void); |
56 | extern void memblock_analyze(void); | 56 | void memblock_analyze(void); |
57 | extern long memblock_add(phys_addr_t base, phys_addr_t size); | 57 | int memblock_add(phys_addr_t base, phys_addr_t size); |
58 | extern long memblock_remove(phys_addr_t base, phys_addr_t size); | 58 | int memblock_remove(phys_addr_t base, phys_addr_t size); |
59 | extern long memblock_free(phys_addr_t base, phys_addr_t size); | 59 | int memblock_free(phys_addr_t base, phys_addr_t size); |
60 | extern long memblock_reserve(phys_addr_t base, phys_addr_t size); | 60 | int memblock_reserve(phys_addr_t base, phys_addr_t size); |
61 | 61 | ||
62 | extern void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, | 62 | void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, |
63 | phys_addr_t *out_end, int *out_nid); | 63 | phys_addr_t *out_end, int *out_nid); |
64 | 64 | ||
65 | /** | 65 | /** |
66 | * for_each_free_mem_range - iterate through free memblock areas | 66 | * for_each_free_mem_range - iterate through free memblock areas |
@@ -80,7 +80,7 @@ extern void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, | |||
80 | __next_free_mem_range(&i, nid, p_start, p_end, p_nid)) | 80 | __next_free_mem_range(&i, nid, p_start, p_end, p_nid)) |
81 | 81 | ||
82 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 82 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
83 | extern int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); | 83 | int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); |
84 | 84 | ||
85 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) | 85 | static inline void memblock_set_region_node(struct memblock_region *r, int nid) |
86 | { | 86 | { |
@@ -105,37 +105,31 @@ static inline int memblock_get_region_node(const struct memblock_region *r) | |||
105 | /* The numa aware allocator is only available if | 105 | /* The numa aware allocator is only available if |
106 | * CONFIG_ARCH_POPULATES_NODE_MAP is set | 106 | * CONFIG_ARCH_POPULATES_NODE_MAP is set |
107 | */ | 107 | */ |
108 | extern phys_addr_t memblock_find_in_range_node(phys_addr_t start, | 108 | phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, |
109 | phys_addr_t end, | 109 | phys_addr_t size, phys_addr_t align, int nid); |
110 | phys_addr_t size, | 110 | phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid); |
111 | phys_addr_t align, int nid); | 111 | phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, int nid); |
112 | extern phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, | ||
113 | int nid); | ||
114 | extern phys_addr_t memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align, | ||
115 | int nid); | ||
116 | 112 | ||
117 | extern phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); | 113 | phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t align); |
118 | 114 | ||
119 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ | 115 | /* Flags for memblock_alloc_base() amd __memblock_alloc_base() */ |
120 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) | 116 | #define MEMBLOCK_ALLOC_ANYWHERE (~(phys_addr_t)0) |
121 | #define MEMBLOCK_ALLOC_ACCESSIBLE 0 | 117 | #define MEMBLOCK_ALLOC_ACCESSIBLE 0 |
122 | 118 | ||
123 | extern phys_addr_t memblock_alloc_base(phys_addr_t size, | 119 | phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align, |
124 | phys_addr_t align, | 120 | phys_addr_t max_addr); |
125 | phys_addr_t max_addr); | 121 | phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, |
126 | extern phys_addr_t __memblock_alloc_base(phys_addr_t size, | 122 | phys_addr_t max_addr); |
127 | phys_addr_t align, | 123 | phys_addr_t memblock_phys_mem_size(void); |
128 | phys_addr_t max_addr); | 124 | phys_addr_t memblock_start_of_DRAM(void); |
129 | extern phys_addr_t memblock_phys_mem_size(void); | 125 | phys_addr_t memblock_end_of_DRAM(void); |
130 | extern phys_addr_t memblock_start_of_DRAM(void); | 126 | void memblock_enforce_memory_limit(phys_addr_t memory_limit); |
131 | extern phys_addr_t memblock_end_of_DRAM(void); | 127 | int memblock_is_memory(phys_addr_t addr); |
132 | extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); | 128 | int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); |
133 | extern int memblock_is_memory(phys_addr_t addr); | 129 | int memblock_is_reserved(phys_addr_t addr); |
134 | extern int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); | 130 | int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); |
135 | extern int memblock_is_reserved(phys_addr_t addr); | 131 | |
136 | extern int memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); | 132 | void memblock_dump_all(void); |
137 | |||
138 | extern void memblock_dump_all(void); | ||
139 | 133 | ||
140 | /** | 134 | /** |
141 | * memblock_set_current_limit - Set the current allocation limit to allow | 135 | * memblock_set_current_limit - Set the current allocation limit to allow |
@@ -143,7 +137,7 @@ extern void memblock_dump_all(void); | |||
143 | * accessible during boot | 137 | * accessible during boot |
144 | * @limit: New limit value (physical address) | 138 | * @limit: New limit value (physical address) |
145 | */ | 139 | */ |
146 | extern void memblock_set_current_limit(phys_addr_t limit); | 140 | void memblock_set_current_limit(phys_addr_t limit); |
147 | 141 | ||
148 | 142 | ||
149 | /* | 143 | /* |