linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: kernel test robot <lkp@intel.com>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mike Kravetz <mike.kravetz@oracle.com>
Subject: Re: [linux-next:master 5107/5720] arch/arm64/mm/hugetlbpage.c:380:9: error: duplicate case value
Date: Mon, 27 Jun 2022 13:55:37 +0800	[thread overview]
Message-ID: <a14e7b39-6a8a-4609-b4a1-84ac574f5c96@linux.alibaba.com> (raw)
In-Reply-To: <202206260802.ZqhIhrmv-lkp@intel.com>



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@intel.com>

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	
> 


      reply	other threads:[~2022-06-27  5:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26  0:03 kernel test robot
2022-06-27  5:55 ` Baolin Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a14e7b39-6a8a-4609-b4a1-84ac574f5c96@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=mike.kravetz@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox