[arnd-asm-generic:dma-sync-rework 12/20] arch/mips/mm/dma-noncoherent.c:63:17: error: expected declaration specifiers or '...' before '(' token

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git dma-sync-rework
head:   9a711fbea373208c1eeb2fafb0c744bc23a79a43
commit: 4a04caf3aca03b0132be4519f2064ce6fc6a0f24 [12/20] mips: dma-mapping: split out cache operation logic
config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20230324/202303242356.VaoqPWHL-lkp@xxxxxxxxx/config)
compiler: mips-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git/commit/?id=4a04caf3aca03b0132be4519f2064ce6fc6a0f24
        git remote add arnd-asm-generic https://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
        git fetch --no-tags arnd-asm-generic dma-sync-rework
        git checkout 4a04caf3aca03b0132be4519f2064ce6fc6a0f24
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202303242356.VaoqPWHL-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> arch/mips/mm/dma-noncoherent.c:63:17: error: expected declaration specifiers or '...' before '(' token
      63 |                 (void)(*cache_op)(unsigned long start, unsigned long size));
         |                 ^
>> arch/mips/mm/dma-noncoherent.c:64:1: error: expected identifier or '(' before '{' token
      64 | {
         | ^
   arch/mips/mm/dma-noncoherent.c: In function 'arch_sync_dma_for_device':
>> arch/mips/mm/dma-noncoherent.c:93:17: error: implicit declaration of function 'dma_sync_phys'; did you mean 'dma_to_phys'? [-Werror=implicit-function-declaration]
      93 |                 dma_sync_phys(paddr, size, _dma_cache_wback);
         |                 ^~~~~~~~~~~~~
         |                 dma_to_phys
   cc1: some warnings being treated as errors


vim +63 arch/mips/mm/dma-noncoherent.c

    56	
    57	/*
    58	 * A single sg entry may refer to multiple physically contiguous pages.  But
    59	 * we still need to process highmem pages individually.  If highmem is not
    60	 * configured then the bulk of this loop gets optimized out.
    61	 */
    62	static inline void dma_sync_phys(phys_addr_t paddr, size_t size,
  > 63			(void)(*cache_op)(unsigned long start, unsigned long size));
  > 64	{
    65		struct page *page = pfn_to_page(paddr >> PAGE_SHIFT);
    66		unsigned long offset = paddr & ~PAGE_MASK;
    67		size_t left = size;
    68	
    69		do {
    70			size_t len = left;
    71			void *addr;
    72	
    73			if (PageHighMem(page)) {
    74				if (offset + len > PAGE_SIZE)
    75					len = PAGE_SIZE - offset;
    76			}
    77	
    78			addr = kmap_atomic(page);
    79			cache_op(addr + offset, len);
    80			kunmap_atomic(addr);
    81	
    82			offset = 0;
    83			page++;
    84			left -= len;
    85		} while (left);
    86	}
    87	
    88	void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
    89			enum dma_data_direction dir)
    90	{
    91		switch (dir) {
    92		case DMA_TO_DEVICE:
  > 93			dma_sync_phys(paddr, size, _dma_cache_wback);
    94			break;
    95		case DMA_FROM_DEVICE:
    96			dma_sync_phys(paddr, size, _dma_cache_inv);
    97			break;
    98		case DMA_BIDIRECTIONAL:
    99			if (IS_ENABLED(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) &&
   100			    cpu_needs_post_dma_flush())
   101				dma_sync_phys(paddr, size, _dma_cache_wback);
   102			else
   103				dma_sync_phys(paddr, size, _dma_cache_wback_inv);
   104			break;
   105		default:
   106			break;
   107		}
   108	}
   109	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux