aboutsummaryrefslogtreecommitdiffstats
path: root/mm/cma.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2014-08-06 19:05:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 21:01:16 -0400
commitc1f733aaaf30a0068a3126d5aa9d5b4c25ba4c0c (patch)
tree1ce1c8d6c2c76afcd2672e2d7a623fe62187bffb /mm/cma.c
parentb7155e76a702d97553660828347b9f10858b4dd5 (diff)
mm, CMA: change cma_declare_contiguous() to obey coding convention
Conventionally, we put output param to the end of param list and put the 'base' ahead of 'size', but cma_declare_contiguous() doesn't look like that, so change it. Additionally, move down cma_areas reference code to the position where it is really needed. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Alexander Graf <agraf@suse.de> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Gleb Natapov <gleb@kernel.org> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/cma.c')
-rw-r--r--mm/cma.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mm/cma.c b/mm/cma.c
index 103a6663b7c7..488e50810ed1 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -141,13 +141,13 @@ core_initcall(cma_init_reserved_areas);
141 141
142/** 142/**
143 * cma_declare_contiguous() - reserve custom contiguous area 143 * cma_declare_contiguous() - reserve custom contiguous area
144 * @size: Size of the reserved area (in bytes),
145 * @base: Base address of the reserved area optional, use 0 for any 144 * @base: Base address of the reserved area optional, use 0 for any
145 * @size: Size of the reserved area (in bytes),
146 * @limit: End address of the reserved memory (optional, 0 for any). 146 * @limit: End address of the reserved memory (optional, 0 for any).
147 * @alignment: Alignment for the CMA area, should be power of 2 or zero 147 * @alignment: Alignment for the CMA area, should be power of 2 or zero
148 * @order_per_bit: Order of pages represented by one bit on bitmap. 148 * @order_per_bit: Order of pages represented by one bit on bitmap.
149 * @res_cma: Pointer to store the created cma region.
150 * @fixed: hint about where to place the reserved area 149 * @fixed: hint about where to place the reserved area
150 * @res_cma: Pointer to store the created cma region.
151 * 151 *
152 * This function reserves memory from early allocator. It should be 152 * This function reserves memory from early allocator. It should be
153 * called by arch specific code once the early allocator (memblock or bootmem) 153 * called by arch specific code once the early allocator (memblock or bootmem)
@@ -157,12 +157,12 @@ core_initcall(cma_init_reserved_areas);
157 * If @fixed is true, reserve contiguous area at exactly @base. If false, 157 * If @fixed is true, reserve contiguous area at exactly @base. If false,
158 * reserve in range from @base to @limit. 158 * reserve in range from @base to @limit.
159 */ 159 */
160int __init cma_declare_contiguous(phys_addr_t size, 160int __init cma_declare_contiguous(phys_addr_t base,
161 phys_addr_t base, phys_addr_t limit, 161 phys_addr_t size, phys_addr_t limit,
162 phys_addr_t alignment, unsigned int order_per_bit, 162 phys_addr_t alignment, unsigned int order_per_bit,
163 struct cma **res_cma, bool fixed) 163 bool fixed, struct cma **res_cma)
164{ 164{
165 struct cma *cma = &cma_areas[cma_area_count]; 165 struct cma *cma;
166 int ret = 0; 166 int ret = 0;
167 167
168 pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", 168 pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n",
@@ -218,6 +218,7 @@ int __init cma_declare_contiguous(phys_addr_t size,
218 * Each reserved area must be initialised later, when more kernel 218 * Each reserved area must be initialised later, when more kernel
219 * subsystems (like slab allocator) are available. 219 * subsystems (like slab allocator) are available.
220 */ 220 */
221 cma = &cma_areas[cma_area_count];
221 cma->base_pfn = PFN_DOWN(base); 222 cma->base_pfn = PFN_DOWN(base);
222 cma->count = size >> PAGE_SHIFT; 223 cma->count = size >> PAGE_SHIFT;
223 cma->order_per_bit = order_per_bit; 224 cma->order_per_bit = order_per_bit;