All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
@ 2022-05-22 21:19 kernel test robot
  2022-05-24 20:56   ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2022-05-22 21:19 UTC (permalink / raw)
  To: Qinglin Pan; +Cc: kbuild-all, linux-kernel, Palmer Dabbelt

Hi Qinglin,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4b0986a3613c92f4ec1bdc7f60ec66fea135991f
commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
date:   3 months ago
config: riscv-randconfig-r042-20220522 (https://download.01.org/0day-ci/archive/20220523/202205230554.bQhtkCTA-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.3.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 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>

All warnings (new ones prefixed by >>):

   arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c: At top level:
   arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
     813 | void __init pt_ops_set_early(void)
         |             ^~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
     835 | void __init pt_ops_set_fixmap(void)
         |             ^~~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
     853 | void __init pt_ops_set_late(void)
         |             ^~~~~~~~~~~~~~~


vim +/if +782 arch/riscv/mm/init.c

   764	
   765	/*
   766	 * Setup a 4MB mapping that encompasses the device tree: for 64-bit kernel,
   767	 * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
   768	 * entry.
   769	 */
   770	static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
   771	{
   772	#ifndef CONFIG_BUILTIN_DTB
   773		uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
   774	
   775		create_pgd_mapping(early_pg_dir, DTB_EARLY_BASE_VA,
   776				   IS_ENABLED(CONFIG_64BIT) ? early_dtb_pgd_next : pa,
   777				   PGDIR_SIZE,
   778				   IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
   779	
   780		if (pgtable_l5_enabled)
   781			create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
 > 782					   (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
   783	
   784		if (pgtable_l4_enabled)
   785			create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
   786					   (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
   787	
   788		if (IS_ENABLED(CONFIG_64BIT)) {
   789			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
   790					   pa, PMD_SIZE, PAGE_KERNEL);
   791			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA + PMD_SIZE,
   792					   pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL);
   793		}
   794	
   795		dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1));
   796	#else
   797		/*
   798		 * For 64-bit kernel, __va can't be used since it would return a linear
   799		 * mapping address whereas dtb_early_va will be used before
   800		 * setup_vm_final installs the linear mapping. For 32-bit kernel, as the
   801		 * kernel is mapped in the linear mapping, that makes no difference.
   802		 */
   803		dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa));
   804	#endif
   805	
   806		dtb_early_pa = dtb_pa;
   807	}
   808	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* Re: arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
  2022-05-22 21:19 arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement kernel test robot
@ 2022-05-24 20:56   ` Randy Dunlap
  0 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2022-05-24 20:56 UTC (permalink / raw)
  To: kernel test robot, Qinglin Pan; +Cc: kbuild-all, linux-kernel, Palmer Dabbelt

Hi Palmer,

On 5/22/22 14:19, kernel test robot wrote:
> Hi Qinglin,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   4b0986a3613c92f4ec1bdc7f60ec66fea135991f
> commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
> date:   3 months ago
> config: riscv-randconfig-r042-20220522 (https://download.01.org/0day-ci/archive/20220523/202205230554.bQhtkCTA-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 11.3.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 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>
> 
> All warnings (new ones prefixed by >>):
> 
>    arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c: At top level:
>    arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
>      813 | void __init pt_ops_set_early(void)
>          |             ^~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
>      835 | void __init pt_ops_set_fixmap(void)
>          |             ^~~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
>      853 | void __init pt_ops_set_late(void)
>          |             ^~~~~~~~~~~~~~~

What is the status of your patch for this build warning?

[PATCH v2 1/4] RISC-V: Avoid empty create_*_mapping definitions

Thanks.

-- 
~Randy

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

* Re: arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
@ 2022-05-24 20:56   ` Randy Dunlap
  0 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2022-05-24 20:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2981 bytes --]

Hi Palmer,

On 5/22/22 14:19, kernel test robot wrote:
> Hi Qinglin,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   4b0986a3613c92f4ec1bdc7f60ec66fea135991f
> commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
> date:   3 months ago
> config: riscv-randconfig-r042-20220522 (https://download.01.org/0day-ci/archive/20220523/202205230554.bQhtkCTA-lkp(a)intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 11.3.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 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>
> 
> All warnings (new ones prefixed by >>):
> 
>    arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c: At top level:
>    arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
>      813 | void __init pt_ops_set_early(void)
>          |             ^~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
>      835 | void __init pt_ops_set_fixmap(void)
>          |             ^~~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
>      853 | void __init pt_ops_set_late(void)
>          |             ^~~~~~~~~~~~~~~

What is the status of your patch for this build warning?

[PATCH v2 1/4] RISC-V: Avoid empty create_*_mapping definitions

Thanks.

-- 
~Randy

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

* Re: arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
  2022-03-27 16:05 kernel test robot
@ 2022-04-19 20:17   ` Palmer Dabbelt
  0 siblings, 0 replies; 7+ messages in thread
From: Palmer Dabbelt @ 2022-04-19 20:17 UTC (permalink / raw)
  To: lkp, panqinglin2020; +Cc: kbuild-all, linux-kernel

On Sun, 27 Mar 2022 09:05:03 PDT (-0700), lkp@intel.com wrote:
> Hi Qinglin,
>
> FYI, the error/warning still remains.

Thanks.  I'm not sure if I missed a patch for this, I can't find 
anything that looks relevant in my inbox.  I just sent one of my own to 
fix the issue, but if there's one I missed then happy to take that 
instead.

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   f022814633e1c600507b3a99691b4d624c2813f0
> commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
> date:   6 weeks ago
> config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20220328/202203280003.jGKBNwrv-lkp@intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 11.2.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
>    arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c: At top level:
>    arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
>      813 | void __init pt_ops_set_early(void)
>          |             ^~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
>      835 | void __init pt_ops_set_fixmap(void)
>          |             ^~~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
>      853 | void __init pt_ops_set_late(void)
>          |             ^~~~~~~~~~~~~~~
>
>
> vim +/if +782 arch/riscv/mm/init.c
>
>    764
>    765	/*
>    766	 * Setup a 4MB mapping that encompasses the device tree: for 64-bit kernel,
>    767	 * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
>    768	 * entry.
>    769	 */
>    770	static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
>    771	{
>    772	#ifndef CONFIG_BUILTIN_DTB
>    773		uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
>    774
>    775		create_pgd_mapping(early_pg_dir, DTB_EARLY_BASE_VA,
>    776				   IS_ENABLED(CONFIG_64BIT) ? early_dtb_pgd_next : pa,
>    777				   PGDIR_SIZE,
>    778				   IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
>    779
>    780		if (pgtable_l5_enabled)
>    781			create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
>  > 782					   (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>    783
>    784		if (pgtable_l4_enabled)
>    785			create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
>    786					   (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>    787
>    788		if (IS_ENABLED(CONFIG_64BIT)) {
>    789			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
>    790					   pa, PMD_SIZE, PAGE_KERNEL);
>    791			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA + PMD_SIZE,
>    792					   pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL);
>    793		}
>    794
>    795		dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1));
>    796	#else
>    797		/*
>    798		 * For 64-bit kernel, __va can't be used since it would return a linear
>    799		 * mapping address whereas dtb_early_va will be used before
>    800		 * setup_vm_final installs the linear mapping. For 32-bit kernel, as the
>    801		 * kernel is mapped in the linear mapping, that makes no difference.
>    802		 */
>    803		dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa));
>    804	#endif
>    805
>    806		dtb_early_pa = dtb_pa;
>    807	}
>    808

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

* Re: arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
@ 2022-04-19 20:17   ` Palmer Dabbelt
  0 siblings, 0 replies; 7+ messages in thread
From: Palmer Dabbelt @ 2022-04-19 20:17 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4996 bytes --]

On Sun, 27 Mar 2022 09:05:03 PDT (-0700), lkp(a)intel.com wrote:
> Hi Qinglin,
>
> FYI, the error/warning still remains.

Thanks.  I'm not sure if I missed a patch for this, I can't find 
anything that looks relevant in my inbox.  I just sent one of my own to 
fix the issue, but if there's one I missed then happy to take that 
instead.

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   f022814633e1c600507b3a99691b4d624c2813f0
> commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
> date:   6 weeks ago
> config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20220328/202203280003.jGKBNwrv-lkp(a)intel.com/config)
> compiler: riscv32-linux-gcc (GCC) 11.2.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
>         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>         git fetch --no-tags linus master
>         git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All warnings (new ones prefixed by >>):
>
>    arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
>      786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>          |                                                                                   ^
>    arch/riscv/mm/init.c: At top level:
>    arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
>      813 | void __init pt_ops_set_early(void)
>          |             ^~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
>      835 | void __init pt_ops_set_fixmap(void)
>          |             ^~~~~~~~~~~~~~~~~
>    arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
>      853 | void __init pt_ops_set_late(void)
>          |             ^~~~~~~~~~~~~~~
>
>
> vim +/if +782 arch/riscv/mm/init.c
>
>    764
>    765	/*
>    766	 * Setup a 4MB mapping that encompasses the device tree: for 64-bit kernel,
>    767	 * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
>    768	 * entry.
>    769	 */
>    770	static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
>    771	{
>    772	#ifndef CONFIG_BUILTIN_DTB
>    773		uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
>    774
>    775		create_pgd_mapping(early_pg_dir, DTB_EARLY_BASE_VA,
>    776				   IS_ENABLED(CONFIG_64BIT) ? early_dtb_pgd_next : pa,
>    777				   PGDIR_SIZE,
>    778				   IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
>    779
>    780		if (pgtable_l5_enabled)
>    781			create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
>  > 782					   (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
>    783
>    784		if (pgtable_l4_enabled)
>    785			create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
>    786					   (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
>    787
>    788		if (IS_ENABLED(CONFIG_64BIT)) {
>    789			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
>    790					   pa, PMD_SIZE, PAGE_KERNEL);
>    791			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA + PMD_SIZE,
>    792					   pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL);
>    793		}
>    794
>    795		dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1));
>    796	#else
>    797		/*
>    798		 * For 64-bit kernel, __va can't be used since it would return a linear
>    799		 * mapping address whereas dtb_early_va will be used before
>    800		 * setup_vm_final installs the linear mapping. For 32-bit kernel, as the
>    801		 * kernel is mapped in the linear mapping, that makes no difference.
>    802		 */
>    803		dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa));
>    804	#endif
>    805
>    806		dtb_early_pa = dtb_pa;
>    807	}
>    808

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

* arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
@ 2022-04-11 22:16 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2022-04-11 22:16 UTC (permalink / raw)
  To: Qinglin Pan; +Cc: kbuild-all, linux-kernel, Palmer Dabbelt

Hi Qinglin,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ce522ba9ef7e2d9fb22a39eb3371c0c64e2a433e
commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
date:   8 weeks ago
config: riscv-randconfig-r042-20220411 (https://download.01.org/0day-ci/archive/20220412/202204120608.ZG1VLqBr-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.2.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c: At top level:
   arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
     813 | void __init pt_ops_set_early(void)
         |             ^~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
     835 | void __init pt_ops_set_fixmap(void)
         |             ^~~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
     853 | void __init pt_ops_set_late(void)
         |             ^~~~~~~~~~~~~~~


vim +/if +782 arch/riscv/mm/init.c

   764	
   765	/*
   766	 * Setup a 4MB mapping that encompasses the device tree: for 64-bit kernel,
   767	 * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
   768	 * entry.
   769	 */
   770	static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
   771	{
   772	#ifndef CONFIG_BUILTIN_DTB
   773		uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
   774	
   775		create_pgd_mapping(early_pg_dir, DTB_EARLY_BASE_VA,
   776				   IS_ENABLED(CONFIG_64BIT) ? early_dtb_pgd_next : pa,
   777				   PGDIR_SIZE,
   778				   IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
   779	
   780		if (pgtable_l5_enabled)
   781			create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
 > 782					   (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
   783	
   784		if (pgtable_l4_enabled)
   785			create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
   786					   (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
   787	
   788		if (IS_ENABLED(CONFIG_64BIT)) {
   789			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
   790					   pa, PMD_SIZE, PAGE_KERNEL);
   791			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA + PMD_SIZE,
   792					   pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL);
   793		}
   794	
   795		dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1));
   796	#else
   797		/*
   798		 * For 64-bit kernel, __va can't be used since it would return a linear
   799		 * mapping address whereas dtb_early_va will be used before
   800		 * setup_vm_final installs the linear mapping. For 32-bit kernel, as the
   801		 * kernel is mapped in the linear mapping, that makes no difference.
   802		 */
   803		dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa));
   804	#endif
   805	
   806		dtb_early_pa = dtb_pa;
   807	}
   808	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

* arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement
@ 2022-03-27 16:05 kernel test robot
  2022-04-19 20:17   ` Palmer Dabbelt
  0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2022-03-27 16:05 UTC (permalink / raw)
  To: Qinglin Pan; +Cc: kbuild-all, linux-kernel, Palmer Dabbelt

Hi Qinglin,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f022814633e1c600507b3a99691b4d624c2813f0
commit: 677b9eb8810edc6c616a699018a83e24ed0cccab riscv: mm: Prepare pt_ops helper functions for sv57
date:   6 weeks ago
config: riscv-rv32_defconfig (https://download.01.org/0day-ci/archive/20220328/202203280003.jGKBNwrv-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.2.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/torvalds/linux.git/commit/?id=677b9eb8810edc6c616a699018a83e24ed0cccab
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 677b9eb8810edc6c616a699018a83e24ed0cccab
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash arch/riscv/mm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/riscv/mm/init.c: In function 'create_fdt_early_page_table':
>> arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     782 |                                    (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c:786:83: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
     786 |                                    (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
         |                                                                                   ^
   arch/riscv/mm/init.c: At top level:
   arch/riscv/mm/init.c:813:13: warning: no previous prototype for 'pt_ops_set_early' [-Wmissing-prototypes]
     813 | void __init pt_ops_set_early(void)
         |             ^~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:835:13: warning: no previous prototype for 'pt_ops_set_fixmap' [-Wmissing-prototypes]
     835 | void __init pt_ops_set_fixmap(void)
         |             ^~~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:853:13: warning: no previous prototype for 'pt_ops_set_late' [-Wmissing-prototypes]
     853 | void __init pt_ops_set_late(void)
         |             ^~~~~~~~~~~~~~~


vim +/if +782 arch/riscv/mm/init.c

   764	
   765	/*
   766	 * Setup a 4MB mapping that encompasses the device tree: for 64-bit kernel,
   767	 * this means 2 PMD entries whereas for 32-bit kernel, this is only 1 PGDIR
   768	 * entry.
   769	 */
   770	static void __init create_fdt_early_page_table(pgd_t *pgdir, uintptr_t dtb_pa)
   771	{
   772	#ifndef CONFIG_BUILTIN_DTB
   773		uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
   774	
   775		create_pgd_mapping(early_pg_dir, DTB_EARLY_BASE_VA,
   776				   IS_ENABLED(CONFIG_64BIT) ? early_dtb_pgd_next : pa,
   777				   PGDIR_SIZE,
   778				   IS_ENABLED(CONFIG_64BIT) ? PAGE_TABLE : PAGE_KERNEL);
   779	
   780		if (pgtable_l5_enabled)
   781			create_p4d_mapping(early_dtb_p4d, DTB_EARLY_BASE_VA,
 > 782					   (uintptr_t)early_dtb_pud, P4D_SIZE, PAGE_TABLE);
   783	
   784		if (pgtable_l4_enabled)
   785			create_pud_mapping(early_dtb_pud, DTB_EARLY_BASE_VA,
   786					   (uintptr_t)early_dtb_pmd, PUD_SIZE, PAGE_TABLE);
   787	
   788		if (IS_ENABLED(CONFIG_64BIT)) {
   789			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA,
   790					   pa, PMD_SIZE, PAGE_KERNEL);
   791			create_pmd_mapping(early_dtb_pmd, DTB_EARLY_BASE_VA + PMD_SIZE,
   792					   pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL);
   793		}
   794	
   795		dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1));
   796	#else
   797		/*
   798		 * For 64-bit kernel, __va can't be used since it would return a linear
   799		 * mapping address whereas dtb_early_va will be used before
   800		 * setup_vm_final installs the linear mapping. For 32-bit kernel, as the
   801		 * kernel is mapped in the linear mapping, that makes no difference.
   802		 */
   803		dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa));
   804	#endif
   805	
   806		dtb_early_pa = dtb_pa;
   807	}
   808	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-05-24 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22 21:19 arch/riscv/mm/init.c:782:83: warning: suggest braces around empty body in an 'if' statement kernel test robot
2022-05-24 20:56 ` Randy Dunlap
2022-05-24 20:56   ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2022-04-11 22:16 kernel test robot
2022-03-27 16:05 kernel test robot
2022-04-19 20:17 ` Palmer Dabbelt
2022-04-19 20:17   ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.