From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030808AbaGRNyO (ORCPT ); Fri, 18 Jul 2014 09:54:14 -0400 Received: from fw-tnat.austin.arm.com ([217.140.110.23]:43446 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030649AbaGRNyL (ORCPT ); Fri, 18 Jul 2014 09:54:11 -0400 Date: Fri, 18 Jul 2014 14:53:49 +0100 From: Catalin Marinas To: Laura Abbott Cc: Will Deacon , David Riley , "linux-arm-kernel@lists.infradead.org" , Ritesh Harjain , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCHv4 3/5] common: dma-mapping: Introduce common remapping functions Message-ID: <20140718135349.GB4608@arm.com> References: <1404324218-4743-1-git-send-email-lauraa@codeaurora.org> <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> 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 Wed, Jul 02, 2014 at 07:03:36PM +0100, Laura Abbott wrote: > +void *dma_common_pages_remap(struct page **pages, size_t size, > + unsigned long vm_flags, pgprot_t prot, > + const void *caller) > +{ > + struct vm_struct *area; > + > + area = get_vm_area_caller(size, vm_flags, caller); > + if (!area) > + return NULL; > + > + if (map_vm_area(area, prot, &pages)) { > + vunmap(area->addr); > + return NULL; > + } > + > + return area->addr; > +} Why not just replace this function with vmap()? It is nearly identical. -- Catalin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa0-f44.google.com (mail-oa0-f44.google.com [209.85.219.44]) by kanga.kvack.org (Postfix) with ESMTP id 600E76B0037 for ; Fri, 18 Jul 2014 09:54:17 -0400 (EDT) Received: by mail-oa0-f44.google.com with SMTP id eb12so3268341oac.31 for ; Fri, 18 Jul 2014 06:54:16 -0700 (PDT) Received: from collaborate-mta1.arm.com (fw-tnat.austin.arm.com. [217.140.110.23]) by mx.google.com with ESMTP id qk5si13657500obb.30.2014.07.18.06.54.13 for ; Fri, 18 Jul 2014 06:54:13 -0700 (PDT) Date: Fri, 18 Jul 2014 14:53:49 +0100 From: Catalin Marinas Subject: Re: [PATCHv4 3/5] common: dma-mapping: Introduce common remapping functions Message-ID: <20140718135349.GB4608@arm.com> References: <1404324218-4743-1-git-send-email-lauraa@codeaurora.org> <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> Sender: owner-linux-mm@kvack.org List-ID: To: Laura Abbott Cc: Will Deacon , David Riley , "linux-arm-kernel@lists.infradead.org" , Ritesh Harjain , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" On Wed, Jul 02, 2014 at 07:03:36PM +0100, Laura Abbott wrote: > +void *dma_common_pages_remap(struct page **pages, size_t size, > + unsigned long vm_flags, pgprot_t prot, > + const void *caller) > +{ > + struct vm_struct *area; > + > + area = get_vm_area_caller(size, vm_flags, caller); > + if (!area) > + return NULL; > + > + if (map_vm_area(area, prot, &pages)) { > + vunmap(area->addr); > + return NULL; > + } > + > + return area->addr; > +} Why not just replace this function with vmap()? It is nearly identical. -- Catalin -- 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 From: catalin.marinas@arm.com (Catalin Marinas) Date: Fri, 18 Jul 2014 14:53:49 +0100 Subject: [PATCHv4 3/5] common: dma-mapping: Introduce common remapping functions In-Reply-To: <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> References: <1404324218-4743-1-git-send-email-lauraa@codeaurora.org> <1404324218-4743-4-git-send-email-lauraa@codeaurora.org> Message-ID: <20140718135349.GB4608@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Jul 02, 2014 at 07:03:36PM +0100, Laura Abbott wrote: > +void *dma_common_pages_remap(struct page **pages, size_t size, > + unsigned long vm_flags, pgprot_t prot, > + const void *caller) > +{ > + struct vm_struct *area; > + > + area = get_vm_area_caller(size, vm_flags, caller); > + if (!area) > + return NULL; > + > + if (map_vm_area(area, prot, &pages)) { > + vunmap(area->addr); > + return NULL; > + } > + > + return area->addr; > +} Why not just replace this function with vmap()? It is nearly identical. -- Catalin