Re: [PATCH v7 02/37] asm-generic/io.h: move ioremap_nocache/ioremap_uc/ioremap_wc/ioremap_wt out of ifndef CONFIG_MMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Greentime,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc1 next-20180216]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Greentime-Hu/Andes-nds32-Linux-Kernel-Port/20180216-155013
config: cris-etrax-100lx_v2_defconfig (attached as .config)
compiler: cris-linux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=cris 

All warnings (new ones prefixed by >>):

   In file included from arch/cris/include/asm/io.h:24:0,
                    from include/linux/io.h:25,
                    from arch/cris/mm/ioremap.c:14:
   include/asm-generic/io.h:864:15: error: conflicting types for 'ioremap'
    void __iomem *ioremap(phys_addr_t phys_addr, size_t size);
                  ^~~~~~~
   In file included from include/linux/io.h:25:0,
                    from arch/cris/mm/ioremap.c:14:
   arch/cris/include/asm/io.h:15:30: note: previous definition of 'ioremap' was here
    static inline void __iomem * ioremap (unsigned long offset, unsigned long size)
                                 ^~~~~~~
   In file included from arch/cris/include/asm/io.h:24:0,
                    from include/linux/io.h:25,
                    from arch/cris/mm/ioremap.c:14:
   include/asm-generic/io.h:865:25: error: conflicting types for 'ioremap_nocache'
    #define ioremap_nocache ioremap_nocache
                            ^
   include/asm-generic/io.h:866:29: note: in expansion of macro 'ioremap_nocache'
    static inline void __iomem *ioremap_nocache(phys_addr_t offset, size_t size)
                                ^~~~~~~~~~~~~~~
   In file included from include/linux/io.h:25:0,
                    from arch/cris/mm/ioremap.c:14:
   arch/cris/include/asm/io.h:22:23: note: previous declaration of 'ioremap_nocache' was here
    extern void __iomem * ioremap_nocache(unsigned long offset, unsigned long size);
                          ^~~~~~~~~~~~~~~
   In file included from arch/cris/include/asm/io.h:24:0,
                    from include/linux/io.h:25,
                    from arch/cris/mm/ioremap.c:14:
   include/asm-generic/io.h:865:25: error: conflicting types for 'ioremap_nocache'
    #define ioremap_nocache ioremap_nocache
                            ^
>> arch/cris/mm/ioremap.c:80:15: note: in expansion of macro 'ioremap_nocache'
    void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size)
                  ^~~~~~~~~~~~~~~
   include/asm-generic/io.h:865:25: note: previous definition of 'ioremap_nocache' was here
    #define ioremap_nocache ioremap_nocache
                            ^
   include/asm-generic/io.h:866:29: note: in expansion of macro 'ioremap_nocache'
    static inline void __iomem *ioremap_nocache(phys_addr_t offset, size_t size)
                                ^~~~~~~~~~~~~~~

vim +/ioremap_nocache +80 arch/cris/mm/ioremap.c

e32cbc3d Haavard Skinnemoen 2006-09-30 @14  #include <linux/io.h>
^1da177e Linus Torvalds     2005-04-16  15  #include <asm/pgalloc.h>
556dcee7 Jesper Nilsson     2008-10-21  16  #include <arch/memmap.h>
^1da177e Linus Torvalds     2005-04-16  17  
^1da177e Linus Torvalds     2005-04-16  18  /*
^1da177e Linus Torvalds     2005-04-16  19   * Generic mapping function (not visible outside):
^1da177e Linus Torvalds     2005-04-16  20   */
^1da177e Linus Torvalds     2005-04-16  21  
^1da177e Linus Torvalds     2005-04-16  22  /*
^1da177e Linus Torvalds     2005-04-16  23   * Remap an arbitrary physical address space into the kernel virtual
^1da177e Linus Torvalds     2005-04-16  24   * address space. Needed when the kernel wants to access high addresses
^1da177e Linus Torvalds     2005-04-16  25   * directly.
^1da177e Linus Torvalds     2005-04-16  26   *
^1da177e Linus Torvalds     2005-04-16  27   * NOTE! We need to allow non-page-aligned mappings too: we will obviously
^1da177e Linus Torvalds     2005-04-16  28   * have to convert them into an offset in a page-aligned mapping, but the
^1da177e Linus Torvalds     2005-04-16  29   * caller shouldn't need to know that small detail.
^1da177e Linus Torvalds     2005-04-16  30   */
4f18cfbf Mikael Starvik     2005-07-27  31  void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot)
^1da177e Linus Torvalds     2005-04-16  32  {
4f18cfbf Mikael Starvik     2005-07-27  33  	void __iomem * addr;
^1da177e Linus Torvalds     2005-04-16  34  	struct vm_struct * area;
^1da177e Linus Torvalds     2005-04-16  35  	unsigned long offset, last_addr;
^1da177e Linus Torvalds     2005-04-16  36  
^1da177e Linus Torvalds     2005-04-16  37  	/* Don't allow wraparound or zero size */
^1da177e Linus Torvalds     2005-04-16  38  	last_addr = phys_addr + size - 1;
^1da177e Linus Torvalds     2005-04-16  39  	if (!size || last_addr < phys_addr)
^1da177e Linus Torvalds     2005-04-16  40  		return NULL;
^1da177e Linus Torvalds     2005-04-16  41  
^1da177e Linus Torvalds     2005-04-16  42  	/*
^1da177e Linus Torvalds     2005-04-16  43  	 * Mappings have to be page-aligned
^1da177e Linus Torvalds     2005-04-16  44  	 */
^1da177e Linus Torvalds     2005-04-16  45  	offset = phys_addr & ~PAGE_MASK;
^1da177e Linus Torvalds     2005-04-16  46  	phys_addr &= PAGE_MASK;
^1da177e Linus Torvalds     2005-04-16  47  	size = PAGE_ALIGN(last_addr+1) - phys_addr;
^1da177e Linus Torvalds     2005-04-16  48  
^1da177e Linus Torvalds     2005-04-16  49  	/*
^1da177e Linus Torvalds     2005-04-16  50  	 * Ok, go for it..
^1da177e Linus Torvalds     2005-04-16  51  	 */
^1da177e Linus Torvalds     2005-04-16  52  	area = get_vm_area(size, VM_IOREMAP);
^1da177e Linus Torvalds     2005-04-16  53  	if (!area)
^1da177e Linus Torvalds     2005-04-16  54  		return NULL;
4f18cfbf Mikael Starvik     2005-07-27  55  	addr = (void __iomem *)area->addr;
e32cbc3d Haavard Skinnemoen 2006-09-30  56  	if (ioremap_page_range((unsigned long)addr, (unsigned long)addr + size,
e32cbc3d Haavard Skinnemoen 2006-09-30  57  			       phys_addr, prot)) {
4f18cfbf Mikael Starvik     2005-07-27  58  		vfree((void __force *)addr);
^1da177e Linus Torvalds     2005-04-16  59  		return NULL;
^1da177e Linus Torvalds     2005-04-16  60  	}
4f18cfbf Mikael Starvik     2005-07-27  61  	return (void __iomem *) (offset + (char __iomem *)addr);
4f18cfbf Mikael Starvik     2005-07-27  62  }
4f18cfbf Mikael Starvik     2005-07-27  63  
4f18cfbf Mikael Starvik     2005-07-27  64  void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
4f18cfbf Mikael Starvik     2005-07-27  65  {
4f18cfbf Mikael Starvik     2005-07-27  66  	return __ioremap_prot(phys_addr, size,
4f18cfbf Mikael Starvik     2005-07-27  67  		              __pgprot(_PAGE_PRESENT | __READABLE |
4f18cfbf Mikael Starvik     2005-07-27  68  				       __WRITEABLE | _PAGE_GLOBAL |
4f18cfbf Mikael Starvik     2005-07-27  69  				       _PAGE_KERNEL | flags));
4f18cfbf Mikael Starvik     2005-07-27  70  }
4f18cfbf Mikael Starvik     2005-07-27  71  
4f18cfbf Mikael Starvik     2005-07-27  72  /**
4f18cfbf Mikael Starvik     2005-07-27  73   * ioremap_nocache     -   map bus memory into CPU space
4f18cfbf Mikael Starvik     2005-07-27  74   * @offset:    bus address of the memory
4f18cfbf Mikael Starvik     2005-07-27  75   * @size:      size of the resource to map
4f18cfbf Mikael Starvik     2005-07-27  76   *
4f18cfbf Mikael Starvik     2005-07-27  77   * Must be freed with iounmap.
4f18cfbf Mikael Starvik     2005-07-27  78   */
4f18cfbf Mikael Starvik     2005-07-27  79  
4f18cfbf Mikael Starvik     2005-07-27 @80  void __iomem *ioremap_nocache(unsigned long phys_addr, unsigned long size)
4f18cfbf Mikael Starvik     2005-07-27  81  {
4f18cfbf Mikael Starvik     2005-07-27  82          return __ioremap(phys_addr | MEM_NON_CACHEABLE, size, 0);
^1da177e Linus Torvalds     2005-04-16  83  }
82e6df1e Jesper Nilsson     2014-10-01  84  EXPORT_SYMBOL(ioremap_nocache);
^1da177e Linus Torvalds     2005-04-16  85  

:::::: The code at line 80 was first introduced by commit
:::::: 4f18cfbf0990bfc2e8e7706eeb9e5bef898ae923 [PATCH] CRIS update: mm

:::::: TO: Mikael Starvik <mikael.starvik@xxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux