Re: [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value

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

 





On 6/26/2022 8:03 AM, kernel test robot wrote:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2f9cb3d3bd73fc2225d66aa8fcffb632ed3eb235
commit: 8f32147e69adb8259faa07d8e28360ab782363d0 [5107/5720] arm64/hugetlb: implement arm64 specific hugetlb_mask_last_page
config: arm64-randconfig-s031-20220626
compiler: aarch64-linux-gcc (GCC) 11.3.0
reproduce:
         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
         chmod +x ~/bin/make.cross
         # apt-get install sparse
         # sparse version: v0.6.4-31-g4880bd19-dirty
         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8f32147e69adb8259faa07d8e28360ab782363d0
         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
         git fetch --no-tags linux-next master
         git checkout 8f32147e69adb8259faa07d8e28360ab782363d0
         # save the config file
         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/mm/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

Thanks for reporting. I missed the case that '__PAGETABLE_PMD_FOLDED', was defined, which PUD is same with PMD.

Andrew, could you help to fold below changes into the original patch? Thanks.

diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c
index c9e076683e5d..272dd30a26ce 100644
--- a/arch/arm64/mm/hugetlbpage.c
+++ b/arch/arm64/mm/hugetlbpage.c
@@ -373,8 +373,10 @@ unsigned long hugetlb_mask_last_page(struct hstate *h)
        unsigned long hp_size = huge_page_size(h);

        switch (hp_size) {
+#ifndef __PAGETABLE_PMD_FOLDED
        case PUD_SIZE:
                return PGDIR_SIZE - PUD_SIZE;
+#endif
        case CONT_PMD_SIZE:
                return PUD_SIZE - CONT_PMD_SIZE;
        case PMD_SIZE:

All errors (new ones prefixed by >>):

    arch/arm64/mm/hugetlbpage.c: In function 'hugetlb_mask_last_page':
arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
      380 |         case PMD_SIZE:
          |         ^~~~
    arch/arm64/mm/hugetlbpage.c:376:9: note: previously used here
      376 |         case PUD_SIZE:
          |         ^~~~


vim +380 arch/arm64/mm/hugetlbpage.c

    370	
    371	unsigned long hugetlb_mask_last_page(struct hstate *h)
    372	{
    373		unsigned long hp_size = huge_page_size(h);
    374	
    375		switch (hp_size) {
    376		case PUD_SIZE:
    377			return PGDIR_SIZE - PUD_SIZE;
    378		case CONT_PMD_SIZE:
    379			return PUD_SIZE - CONT_PMD_SIZE;
  > 380		case PMD_SIZE:
    381			return PUD_SIZE - PMD_SIZE;
    382		case CONT_PTE_SIZE:
    383			return PMD_SIZE - CONT_PTE_SIZE;
    384		default:
    385			break;
    386		}
    387	
    388		return 0UL;
    389	}
    390	





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux