From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932710AbaFLHTn (ORCPT ); Thu, 12 Jun 2014 03:19:43 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:57779 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932553AbaFLHTl (ORCPT ); Thu, 12 Jun 2014 03:19:41 -0400 X-Original-SENDERIP: 10.177.220.169 X-Original-MAILFROM: minchan@kernel.org Date: Thu, 12 Jun 2014 16:19:31 +0900 From: Minchan Kim To: Joonsoo Kim Cc: Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski , Michal Nazarewicz , Russell King - ARM Linux , kvm@vger.kernel.org, linux-mm@kvack.org, Gleb Natapov , Greg Kroah-Hartman , Alexander Graf , kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 09/10] mm, cma: move output param to the end of param list Message-ID: <20140612071930.GL12415@bbox> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 12, 2014 at 12:21:46PM +0900, Joonsoo Kim wrote: > Conventionally, we put output param to the end of param list. > cma_declare_contiguous() doesn't look like that, so change it. If you says "Conventionally", I'd like to suggest one more thing. Conventionally, we put 'base' ahead 'size' but dma_contiguous_reserve_area is opposite. > > Additionally, move down cma_areas reference code to the position > where it is really needed. > > Signed-off-by: Joonsoo Kim > > diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c > index 28ec226..97613ea 100644 > --- a/arch/powerpc/kvm/book3s_hv_builtin.c > +++ b/arch/powerpc/kvm/book3s_hv_builtin.c > @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void) > > align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); > cma_declare_contiguous(selected_size, 0, 0, align_size, > - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false); > + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma); > } > } > > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index f177f73..bfd4553 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, > { > int ret; > > - ret = cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed); > + ret = cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma); > if (ret) > return ret; > > diff --git a/include/linux/cma.h b/include/linux/cma.h > index e38efe9..e53eead 100644 > --- a/include/linux/cma.h > +++ b/include/linux/cma.h > @@ -6,7 +6,7 @@ struct cma; > extern int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed); > + bool fixed, struct cma **res_cma); > extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); > extern bool cma_release(struct cma *cma, struct page *pages, int count); > #endif > diff --git a/mm/cma.c b/mm/cma.c > index 01a0713..22a5b23 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas); > * @limit: End address of the reserved memory (optional, 0 for any). > * @alignment: Alignment for the contiguous memory area, should be power of 2 > * @order_per_bit: Order of pages represented by one bit on bitmap. > - * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > + * @res_cma: Pointer to store the created cma region. > * > * This function reserves memory from early allocator. It should be > * called by arch specific code once the early allocator (memblock or bootmem) > @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas); > int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed) > + bool fixed, struct cma **res_cma) > { > - struct cma *cma = &cma_areas[cma_area_count]; > + struct cma *cma; > int ret = 0; > > pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", > @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size, > * Each reserved area must be initialised later, when more kernel > * subsystems (like slab allocator) are available. > */ > + cma = &cma_areas[cma_area_count]; > cma->base_pfn = PFN_DOWN(base); > cma->count = size >> PAGE_SHIFT; > cma->order_per_bit = order_per_bit; > -- > 1.7.9.5 -- Kind regards, Minchan Kim From mboxrd@z Thu Jan 1 00:00:00 1970 From: Minchan Kim Subject: Re: [PATCH v2 09/10] mm, cma: move output param to the end of param list Date: Thu, 12 Jun 2014 16:19:31 +0900 Message-ID: <20140612071930.GL12415@bbox> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski , Michal Nazarewicz , Russell King - ARM Linux , kvm@vger.kernel.org, linux-mm@kvack.org, Gleb Natapov , Greg Kroah-Hartman , Alexander Graf , kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org To: Joonsoo Kim Return-path: Content-Disposition: inline In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On Thu, Jun 12, 2014 at 12:21:46PM +0900, Joonsoo Kim wrote: > Conventionally, we put output param to the end of param list. > cma_declare_contiguous() doesn't look like that, so change it. If you says "Conventionally", I'd like to suggest one more thing. Conventionally, we put 'base' ahead 'size' but dma_contiguous_reserve_area is opposite. > > Additionally, move down cma_areas reference code to the position > where it is really needed. > > Signed-off-by: Joonsoo Kim > > diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c > index 28ec226..97613ea 100644 > --- a/arch/powerpc/kvm/book3s_hv_builtin.c > +++ b/arch/powerpc/kvm/book3s_hv_builtin.c > @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void) > > align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); > cma_declare_contiguous(selected_size, 0, 0, align_size, > - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false); > + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma); > } > } > > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index f177f73..bfd4553 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, > { > int ret; > > - ret = cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed); > + ret = cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma); > if (ret) > return ret; > > diff --git a/include/linux/cma.h b/include/linux/cma.h > index e38efe9..e53eead 100644 > --- a/include/linux/cma.h > +++ b/include/linux/cma.h > @@ -6,7 +6,7 @@ struct cma; > extern int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed); > + bool fixed, struct cma **res_cma); > extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); > extern bool cma_release(struct cma *cma, struct page *pages, int count); > #endif > diff --git a/mm/cma.c b/mm/cma.c > index 01a0713..22a5b23 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas); > * @limit: End address of the reserved memory (optional, 0 for any). > * @alignment: Alignment for the contiguous memory area, should be power of 2 > * @order_per_bit: Order of pages represented by one bit on bitmap. > - * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > + * @res_cma: Pointer to store the created cma region. > * > * This function reserves memory from early allocator. It should be > * called by arch specific code once the early allocator (memblock or bootmem) > @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas); > int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed) > + bool fixed, struct cma **res_cma) > { > - struct cma *cma = &cma_areas[cma_area_count]; > + struct cma *cma; > int ret = 0; > > pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", > @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size, > * Each reserved area must be initialised later, when more kernel > * subsystems (like slab allocator) are available. > */ > + cma = &cma_areas[cma_area_count]; > cma->base_pfn = PFN_DOWN(base); > cma->count = size >> PAGE_SHIFT; > cma->order_per_bit = order_per_bit; > -- > 1.7.9.5 -- Kind regards, Minchan Kim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lgemrelse7q.lge.com (LGEMRELSE7Q.lge.com [156.147.1.151]) by lists.ozlabs.org (Postfix) with ESMTP id DE8481A02BC for ; Thu, 12 Jun 2014 17:19:41 +1000 (EST) Date: Thu, 12 Jun 2014 16:19:31 +0900 From: Minchan Kim To: Joonsoo Kim Subject: Re: [PATCH v2 09/10] mm, cma: move output param to the end of param list Message-ID: <20140612071930.GL12415@bbox> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> Cc: kvm-ppc@vger.kernel.org, Russell King - ARM Linux , kvm@vger.kernel.org, Gleb Natapov , Greg Kroah-Hartman , Alexander Graf , Michal Nazarewicz , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Mackerras , "Aneesh Kumar K.V" , Paolo Bonzini , Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Marek Szyprowski List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thu, Jun 12, 2014 at 12:21:46PM +0900, Joonsoo Kim wrote: > Conventionally, we put output param to the end of param list. > cma_declare_contiguous() doesn't look like that, so change it. If you says "Conventionally", I'd like to suggest one more thing. Conventionally, we put 'base' ahead 'size' but dma_contiguous_reserve_area is opposite. > > Additionally, move down cma_areas reference code to the position > where it is really needed. > > Signed-off-by: Joonsoo Kim > > diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c > index 28ec226..97613ea 100644 > --- a/arch/powerpc/kvm/book3s_hv_builtin.c > +++ b/arch/powerpc/kvm/book3s_hv_builtin.c > @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void) > > align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); > cma_declare_contiguous(selected_size, 0, 0, align_size, > - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false); > + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma); > } > } > > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index f177f73..bfd4553 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, > { > int ret; > > - ret = cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed); > + ret = cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma); > if (ret) > return ret; > > diff --git a/include/linux/cma.h b/include/linux/cma.h > index e38efe9..e53eead 100644 > --- a/include/linux/cma.h > +++ b/include/linux/cma.h > @@ -6,7 +6,7 @@ struct cma; > extern int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed); > + bool fixed, struct cma **res_cma); > extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); > extern bool cma_release(struct cma *cma, struct page *pages, int count); > #endif > diff --git a/mm/cma.c b/mm/cma.c > index 01a0713..22a5b23 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas); > * @limit: End address of the reserved memory (optional, 0 for any). > * @alignment: Alignment for the contiguous memory area, should be power of 2 > * @order_per_bit: Order of pages represented by one bit on bitmap. > - * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > + * @res_cma: Pointer to store the created cma region. > * > * This function reserves memory from early allocator. It should be > * called by arch specific code once the early allocator (memblock or bootmem) > @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas); > int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed) > + bool fixed, struct cma **res_cma) > { > - struct cma *cma = &cma_areas[cma_area_count]; > + struct cma *cma; > int ret = 0; > > pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", > @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size, > * Each reserved area must be initialised later, when more kernel > * subsystems (like slab allocator) are available. > */ > + cma = &cma_areas[cma_area_count]; > cma->base_pfn = PFN_DOWN(base); > cma->count = size >> PAGE_SHIFT; > cma->order_per_bit = order_per_bit; > -- > 1.7.9.5 -- Kind regards, Minchan Kim From mboxrd@z Thu Jan 1 00:00:00 1970 From: minchan@kernel.org (Minchan Kim) Date: Thu, 12 Jun 2014 16:19:31 +0900 Subject: [PATCH v2 09/10] mm, cma: move output param to the end of param list In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> Message-ID: <20140612071930.GL12415@bbox> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Jun 12, 2014 at 12:21:46PM +0900, Joonsoo Kim wrote: > Conventionally, we put output param to the end of param list. > cma_declare_contiguous() doesn't look like that, so change it. If you says "Conventionally", I'd like to suggest one more thing. Conventionally, we put 'base' ahead 'size' but dma_contiguous_reserve_area is opposite. > > Additionally, move down cma_areas reference code to the position > where it is really needed. > > Signed-off-by: Joonsoo Kim > > diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c > index 28ec226..97613ea 100644 > --- a/arch/powerpc/kvm/book3s_hv_builtin.c > +++ b/arch/powerpc/kvm/book3s_hv_builtin.c > @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void) > > align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); > cma_declare_contiguous(selected_size, 0, 0, align_size, > - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false); > + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma); > } > } > > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index f177f73..bfd4553 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, > { > int ret; > > - ret = cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed); > + ret = cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma); > if (ret) > return ret; > > diff --git a/include/linux/cma.h b/include/linux/cma.h > index e38efe9..e53eead 100644 > --- a/include/linux/cma.h > +++ b/include/linux/cma.h > @@ -6,7 +6,7 @@ struct cma; > extern int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed); > + bool fixed, struct cma **res_cma); > extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); > extern bool cma_release(struct cma *cma, struct page *pages, int count); > #endif > diff --git a/mm/cma.c b/mm/cma.c > index 01a0713..22a5b23 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas); > * @limit: End address of the reserved memory (optional, 0 for any). > * @alignment: Alignment for the contiguous memory area, should be power of 2 > * @order_per_bit: Order of pages represented by one bit on bitmap. > - * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > + * @res_cma: Pointer to store the created cma region. > * > * This function reserves memory from early allocator. It should be > * called by arch specific code once the early allocator (memblock or bootmem) > @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas); > int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed) > + bool fixed, struct cma **res_cma) > { > - struct cma *cma = &cma_areas[cma_area_count]; > + struct cma *cma; > int ret = 0; > > pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", > @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size, > * Each reserved area must be initialised later, when more kernel > * subsystems (like slab allocator) are available. > */ > + cma = &cma_areas[cma_area_count]; > cma->base_pfn = PFN_DOWN(base); > cma->count = size >> PAGE_SHIFT; > cma->order_per_bit = order_per_bit; > -- > 1.7.9.5 -- Kind regards, Minchan Kim From mboxrd@z Thu Jan 1 00:00:00 1970 From: Minchan Kim Date: Thu, 12 Jun 2014 07:19:31 +0000 Subject: Re: [PATCH v2 09/10] mm, cma: move output param to the end of param list Message-Id: <20140612071930.GL12415@bbox> List-Id: References: <1402543307-29800-1-git-send-email-iamjoonsoo.kim@lge.com> <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> In-Reply-To: <1402543307-29800-10-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Joonsoo Kim Cc: Andrew Morton , "Aneesh Kumar K.V" , Marek Szyprowski , Michal Nazarewicz , Russell King - ARM Linux , kvm@vger.kernel.org, linux-mm@kvack.org, Gleb Natapov , Greg Kroah-Hartman , Alexander Graf , kvm-ppc@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt , Paolo Bonzini , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org On Thu, Jun 12, 2014 at 12:21:46PM +0900, Joonsoo Kim wrote: > Conventionally, we put output param to the end of param list. > cma_declare_contiguous() doesn't look like that, so change it. If you says "Conventionally", I'd like to suggest one more thing. Conventionally, we put 'base' ahead 'size' but dma_contiguous_reserve_area is opposite. > > Additionally, move down cma_areas reference code to the position > where it is really needed. > > Signed-off-by: Joonsoo Kim > > diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c > index 28ec226..97613ea 100644 > --- a/arch/powerpc/kvm/book3s_hv_builtin.c > +++ b/arch/powerpc/kvm/book3s_hv_builtin.c > @@ -184,7 +184,7 @@ void __init kvm_cma_reserve(void) > > align_size = max(kvm_rma_pages << PAGE_SHIFT, align_size); > cma_declare_contiguous(selected_size, 0, 0, align_size, > - KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, &kvm_cma, false); > + KVM_CMA_CHUNK_ORDER - PAGE_SHIFT, false, &kvm_cma); > } > } > > diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c > index f177f73..bfd4553 100644 > --- a/drivers/base/dma-contiguous.c > +++ b/drivers/base/dma-contiguous.c > @@ -149,7 +149,7 @@ int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base, > { > int ret; > > - ret = cma_declare_contiguous(size, base, limit, 0, 0, res_cma, fixed); > + ret = cma_declare_contiguous(size, base, limit, 0, 0, fixed, res_cma); > if (ret) > return ret; > > diff --git a/include/linux/cma.h b/include/linux/cma.h > index e38efe9..e53eead 100644 > --- a/include/linux/cma.h > +++ b/include/linux/cma.h > @@ -6,7 +6,7 @@ struct cma; > extern int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed); > + bool fixed, struct cma **res_cma); > extern struct page *cma_alloc(struct cma *cma, int count, unsigned int align); > extern bool cma_release(struct cma *cma, struct page *pages, int count); > #endif > diff --git a/mm/cma.c b/mm/cma.c > index 01a0713..22a5b23 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -142,8 +142,8 @@ core_initcall(cma_init_reserved_areas); > * @limit: End address of the reserved memory (optional, 0 for any). > * @alignment: Alignment for the contiguous memory area, should be power of 2 > * @order_per_bit: Order of pages represented by one bit on bitmap. > - * @res_cma: Pointer to store the created cma region. > * @fixed: hint about where to place the reserved area > + * @res_cma: Pointer to store the created cma region. > * > * This function reserves memory from early allocator. It should be > * called by arch specific code once the early allocator (memblock or bootmem) > @@ -156,9 +156,9 @@ core_initcall(cma_init_reserved_areas); > int __init cma_declare_contiguous(phys_addr_t size, > phys_addr_t base, phys_addr_t limit, > phys_addr_t alignment, int order_per_bit, > - struct cma **res_cma, bool fixed) > + bool fixed, struct cma **res_cma) > { > - struct cma *cma = &cma_areas[cma_area_count]; > + struct cma *cma; > int ret = 0; > > pr_debug("%s(size %lx, base %08lx, limit %08lx alignment %08lx)\n", > @@ -214,6 +214,7 @@ int __init cma_declare_contiguous(phys_addr_t size, > * Each reserved area must be initialised later, when more kernel > * subsystems (like slab allocator) are available. > */ > + cma = &cma_areas[cma_area_count]; > cma->base_pfn = PFN_DOWN(base); > cma->count = size >> PAGE_SHIFT; > cma->order_per_bit = order_per_bit; > -- > 1.7.9.5 -- Kind regards, Minchan Kim