drm_vm.c: many arches equate remap_pfn_range() and io_remap_pfn_range()

Robert P. J. Day rpjday at crashcourse.ca
Wed Aug 29 15:29:53 PDT 2012


  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

suggesting that only with ARM need we distinguish between those two
routines.  but for various architectures, in pgtable.h, you can see:

#define io_remap_pfn_range      remap_pfn_range

even the arm file contains:

#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.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


More information about the dri-devel mailing list