[arnd-asm-generic:dma-sync-rework 20/20] arch/openrisc/kernel/dma.c:126:9: warning: this 'for' clause does not guard...

[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: 9a711fbea373208c1eeb2fafb0c744bc23a79a43 [20/20] dma-mapping: replace custom code with generic implementation
config: openrisc-randconfig-r002-20230322 (https://download.01.org/0day-ci/archive/20230324/202303242205.5V2cu64T-lkp@xxxxxxxxx/config)
compiler: or1k-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=9a711fbea373208c1eeb2fafb0c744bc23a79a43
        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 9a711fbea373208c1eeb2fafb0c744bc23a79a43
        # 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=openrisc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash arch/openrisc/kernel/

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/202303242205.5V2cu64T-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   arch/openrisc/kernel/dma.c: In function 'arch_dma_cache_inv':
   arch/openrisc/kernel/dma.c:115:19: error: 'addr' undeclared (first use in this function); did you mean 'paddr'?
     115 |         for (cl = addr; cl < addr + size;
         |                   ^~~~
         |                   paddr
   arch/openrisc/kernel/dma.c:115:19: note: each undeclared identifier is reported only once for each function it appears in
   arch/openrisc/kernel/dma.c: In function 'arch_dma_cache_wback_inv':
   arch/openrisc/kernel/dma.c:126:19: error: 'addr' undeclared (first use in this function); did you mean 'paddr'?
     126 |         for (cl = addr; cl < addr + size;
         |                   ^~~~
         |                   paddr
>> arch/openrisc/kernel/dma.c:126:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     126 |         for (cl = addr; cl < addr + size;
         |         ^~~
   arch/openrisc/kernel/dma.c:129:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     129 |                 break;
         |                 ^~~~~
   arch/openrisc/kernel/dma.c:129:17: error: break statement not within loop or switch


vim +/for +126 arch/openrisc/kernel/dma.c

9a711fbea373208 Arnd Bergmann 2023-03-22  119  
9a711fbea373208 Arnd Bergmann 2023-03-22  120  static inline void arch_dma_cache_wback_inv(phys_addr_t paddr, size_t size)
9a711fbea373208 Arnd Bergmann 2023-03-22  121  {
9a711fbea373208 Arnd Bergmann 2023-03-22  122  	unsigned long cl;
9a711fbea373208 Arnd Bergmann 2023-03-22  123  	struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[smp_processor_id()];
9a711fbea373208 Arnd Bergmann 2023-03-22  124  
586fa29b78e5976 Arnd Bergmann 2023-03-21  125  	/* Flush the dcache for the requested range */
586fa29b78e5976 Arnd Bergmann 2023-03-21 @126  	for (cl = addr; cl < addr + size;
586fa29b78e5976 Arnd Bergmann 2023-03-21  127  	     cl += cpuinfo->dcache_block_size)
586fa29b78e5976 Arnd Bergmann 2023-03-21  128  		mtspr(SPR_DCBFR, cl);
586fa29b78e5976 Arnd Bergmann 2023-03-21  129  		break;
a39af6f7b806f2a Jonas Bonn    2011-06-04  130  }
9a711fbea373208 Arnd Bergmann 2023-03-22  131  

:::::: The code at line 126 was first introduced by commit
:::::: 586fa29b78e59767a0a6d19e82c81e469bae6e08 openrisc: dma-mapping: flush bidirectional mappings

:::::: TO: Arnd Bergmann <arnd@xxxxxxxx>
:::::: CC: Arnd Bergmann <arnd@xxxxxxxx>

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