From: Sascha Hauer Subject: Re: drm_vm.c: many arches equate remap_pfn_range() and io_remap_pfn_range() Date: Thu, 30 Aug 2012 08:45:28 +0200 Message-ID: <20120830064528.GF26594@pengutronix.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 44ABBA028D for ; Wed, 29 Aug 2012 23:45:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: "Robert P. J. Day" Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Aug 29, 2012 at 06:29:53PM -0400, Robert P. J. Day wrote: > > a pedantic observation, you can do with it what you wish (i'm not a > list subscriber). in drivers/gpu/drm/drm_vm.c, we read (line 629): > > #if !defined(__arm__) > if (io_remap_pfn_range(vma, vma->vm_start, > (map->offset + offset) >> PAGE_SHIFT, > vma->vm_end - vma->vm_start, > vma->vm_page_prot)) > return -EAGAIN; > #else > if (remap_pfn_range(vma, vma->vm_start, > (map->offset + offset) >> PAGE_SHIFT, > vma->vm_end - vma->vm_start, > vma->vm_page_prot)) > return -EAGAIN; > #endif This code goes down to: commit 4b7fb9b5746554d460e7bc986341d4b2db01e0b6 Author: Jordan Crouse Date: Thu May 27 13:40:26 2010 -0600 drm: Add __arm defines to DRM Add __arm defines to specify behavior specific for an ARM processor. Signed-off-by: Jordan Crouse Signed-off-by: Dave Airlie Even at that time io_remap_pfn_range on arm was defined as: > > #define io_remap_pfn_range(vma,from,pfn,size,prot) \ > remap_pfn_range(vma, from, pfn, size, prot) > > so it's not clear what the preprocessor test is for. admittedly, it > should work, it just seems unnecessary. and it makes the code more > confusing than it needs to be, but perhaps i've just misread > something. I agree that this shouldn't be necessary. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |