llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [linux-stable-rc:linux-5.15.y 9996/9999] arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension
@ 2023-04-29 20:56 kernel test robot
  2023-04-29 22:45 ` Palmer Dabbelt
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-04-29 20:56 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: llvm, oe-kbuild-all, Greg Kroah-Hartman, Conor Dooley, Palmer Dabbelt

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
head:   64fb7ad7e758c85ebeb0c8c500e4175c65bf5778
commit: 067df57aea8ea9d1d84c53d9925d58759ac90824 [9996/9999] riscv: Move early dtb mapping into the fixmap region
config: riscv-randconfig-r026-20230430 (https://download.01.org/0day-ci/archive/20230430/202304300429.SXZOA5up-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b1465cd49efcbc114a75220b153f5a055ce7911f)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=067df57aea8ea9d1d84c53d9925d58759ac90824
        git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
        git fetch --no-tags linux-stable-rc linux-5.15.y
        git checkout 067df57aea8ea9d1d84c53d9925d58759ac90824
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/

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

All warnings (new ones prefixed by >>):

>> arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
           unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
                         ^
   1 warning generated.


vim +755 arch/riscv/mm/init.c

   731	
   732	static void __init setup_vm_final(void)
   733	{
   734		uintptr_t va, map_size;
   735		phys_addr_t pa, start, end;
   736		u64 i;
   737	
   738		/**
   739		 * MMU is enabled at this point. But page table setup is not complete yet.
   740		 * fixmap page table alloc functions should be used at this point
   741		 */
   742		pt_ops.alloc_pte = alloc_pte_fixmap;
   743		pt_ops.get_pte_virt = get_pte_virt_fixmap;
   744	#ifndef __PAGETABLE_PMD_FOLDED
   745		pt_ops.alloc_pmd = alloc_pmd_fixmap;
   746		pt_ops.get_pmd_virt = get_pmd_virt_fixmap;
   747	#endif
   748		/* Setup swapper PGD for fixmap */
   749	#if !defined(CONFIG_64BIT)
   750		/*
   751		 * In 32-bit, the device tree lies in a pgd entry, so it must be copied
   752		 * directly in swapper_pg_dir in addition to the pgd entry that points
   753		 * to fixmap_pte.
   754		 */
 > 755		unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
   756	
   757		set_pgd(&swapper_pg_dir[idx], early_pg_dir[idx]);
   758	#endif
   759		create_pgd_mapping(swapper_pg_dir, FIXADDR_START,
   760				   __pa_symbol(fixmap_pgd_next),
   761				   PGDIR_SIZE, PAGE_TABLE);
   762	
   763		/* Map all memory banks in the linear mapping */
   764		for_each_mem_range(i, &start, &end) {
   765			if (start >= end)
   766				break;
   767			if (start <= __pa(PAGE_OFFSET) &&
   768			    __pa(PAGE_OFFSET) < end)
   769				start = __pa(PAGE_OFFSET);
   770			if (end >= __pa(PAGE_OFFSET) + memory_limit)
   771				end = __pa(PAGE_OFFSET) + memory_limit;
   772	
   773			map_size = best_map_size(start, end - start);
   774			for (pa = start; pa < end; pa += map_size) {
   775				va = (uintptr_t)__va(pa);
   776	
   777				create_pgd_mapping(swapper_pg_dir, va, pa, map_size,
   778						   pgprot_from_va(va));
   779			}
   780		}
   781	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-stable-rc:linux-5.15.y 9996/9999] arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension
  2023-04-29 20:56 [linux-stable-rc:linux-5.15.y 9996/9999] arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension kernel test robot
@ 2023-04-29 22:45 ` Palmer Dabbelt
  0 siblings, 0 replies; 2+ messages in thread
From: Palmer Dabbelt @ 2023-04-29 22:45 UTC (permalink / raw)
  To: lkp; +Cc: alexghiti, llvm, oe-kbuild-all, Greg KH, Conor Dooley

On Sat, 29 Apr 2023 13:56:13 PDT (-0700), lkp@intel.com wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
> head:   64fb7ad7e758c85ebeb0c8c500e4175c65bf5778
> commit: 067df57aea8ea9d1d84c53d9925d58759ac90824 [9996/9999] riscv: Move early dtb mapping into the fixmap region
> config: riscv-randconfig-r026-20230430 (https://download.01.org/0day-ci/archive/20230430/202304300429.SXZOA5up-lkp@intel.com/config)
> compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b1465cd49efcbc114a75220b153f5a055ce7911f)
> 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
>         # install riscv cross compiling tool for clang build
>         # apt-get install binutils-riscv-linux-gnu
>         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=067df57aea8ea9d1d84c53d9925d58759ac90824
>         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>         git fetch --no-tags linux-stable-rc linux-5.15.y
>         git checkout 067df57aea8ea9d1d84c53d9925d58759ac90824
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202304300429.SXZOA5up-lkp@intel.com/

Thanks, I sent along 
https://lore.kernel.org/r/20230429224330.18699-1-palmer@rivosinc.com/

>
> All warnings (new ones prefixed by >>):
>
>>> arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
>            unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
>                          ^
>    1 warning generated.
>
>
> vim +755 arch/riscv/mm/init.c
>
>    731
>    732	static void __init setup_vm_final(void)
>    733	{
>    734		uintptr_t va, map_size;
>    735		phys_addr_t pa, start, end;
>    736		u64 i;
>    737
>    738		/**
>    739		 * MMU is enabled at this point. But page table setup is not complete yet.
>    740		 * fixmap page table alloc functions should be used at this point
>    741		 */
>    742		pt_ops.alloc_pte = alloc_pte_fixmap;
>    743		pt_ops.get_pte_virt = get_pte_virt_fixmap;
>    744	#ifndef __PAGETABLE_PMD_FOLDED
>    745		pt_ops.alloc_pmd = alloc_pmd_fixmap;
>    746		pt_ops.get_pmd_virt = get_pmd_virt_fixmap;
>    747	#endif
>    748		/* Setup swapper PGD for fixmap */
>    749	#if !defined(CONFIG_64BIT)
>    750		/*
>    751		 * In 32-bit, the device tree lies in a pgd entry, so it must be copied
>    752		 * directly in swapper_pg_dir in addition to the pgd entry that points
>    753		 * to fixmap_pte.
>    754		 */
>  > 755		unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
>    756
>    757		set_pgd(&swapper_pg_dir[idx], early_pg_dir[idx]);
>    758	#endif
>    759		create_pgd_mapping(swapper_pg_dir, FIXADDR_START,
>    760				   __pa_symbol(fixmap_pgd_next),
>    761				   PGDIR_SIZE, PAGE_TABLE);
>    762
>    763		/* Map all memory banks in the linear mapping */
>    764		for_each_mem_range(i, &start, &end) {
>    765			if (start >= end)
>    766				break;
>    767			if (start <= __pa(PAGE_OFFSET) &&
>    768			    __pa(PAGE_OFFSET) < end)
>    769				start = __pa(PAGE_OFFSET);
>    770			if (end >= __pa(PAGE_OFFSET) + memory_limit)
>    771				end = __pa(PAGE_OFFSET) + memory_limit;
>    772
>    773			map_size = best_map_size(start, end - start);
>    774			for (pa = start; pa < end; pa += map_size) {
>    775				va = (uintptr_t)__va(pa);
>    776
>    777				create_pgd_mapping(swapper_pg_dir, va, pa, map_size,
>    778						   pgprot_from_va(va));
>    779			}
>    780		}
>    781

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-29 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29 20:56 [linux-stable-rc:linux-5.15.y 9996/9999] arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension kernel test robot
2023-04-29 22:45 ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).