[davidhildenbrand:cow_fixes_part_3 31/37] arch/powerpc/include/asm/book3s/64/pgtable.h:762:84: error: expected ')' before '}' token

From: kernel test robot
Date: Fri Mar 11 2022 - 09:04:27 EST


tree: git://github.com/davidhildenbrand/linux cow_fixes_part_3
head: 1eea84efeea5e210bb4f92b7d64f4c1cc1aa761d
commit: 43a8e5bbb3d2fe2cd131400b98cbac8f79ba5290 [31/37] powerpc/pgtable: remove _PAGE_BIT_SWAP_TYPE for book3s
config: powerpc64-buildonly-randconfig-r003-20220310 (https://download.01.org/0day-ci/archive/20220311/202203112115.rlyxdAhi-lkp@xxxxxxxxx/config)
compiler: powerpc64-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://github.com/davidhildenbrand/linux/commit/43a8e5bbb3d2fe2cd131400b98cbac8f79ba5290
git remote add davidhildenbrand git://github.com/davidhildenbrand/linux
git fetch --no-tags davidhildenbrand cow_fixes_part_3
git checkout 43a8e5bbb3d2fe2cd131400b98cbac8f79ba5290
# 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=powerpc SHELL=/bin/bash fs/proc/

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

All errors (new ones prefixed by >>):

In file included from arch/powerpc/include/asm/book3s/64/mmu-hash.h:20,
from arch/powerpc/include/asm/book3s/64/mmu.h:38,
from arch/powerpc/include/asm/mmu.h:405,
from arch/powerpc/include/asm/lppaca.h:46,
from arch/powerpc/include/asm/paca.h:17,
from arch/powerpc/include/asm/current.h:13,
from include/linux/thread_info.h:23,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:55,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/mm.h:10,
from include/linux/pagewalk.h:5,
from fs/proc/task_mmu.c:2:
include/linux/swapops.h: In function 'swp_entry_to_pte':
>> arch/powerpc/include/asm/book3s/64/pgtable.h:762:84: error: expected ')' before '}' token
762 | ((type) | (((offset) << PAGE_SHIFT) & PTE_RPN_MASK)})
| ~ ^
include/linux/swapops.h:94:22: note: in expansion of macro '__swp_entry'
94 | arch_entry = __swp_entry(swp_type(entry), swp_offset(entry));
| ^~~~~~~~~~~


vim +762 arch/powerpc/include/asm/book3s/64/pgtable.h

745
746 /* Encode and de-code a swap entry */
747 #define MAX_SWAPFILES_CHECK() do { \
748 BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS); \
749 /* \
750 * Don't have overlapping bits with _PAGE_HPTEFLAGS \
751 * We filter HPTEFLAGS on set_pte. \
752 */ \
753 BUILD_BUG_ON(_PAGE_HPTEFLAGS & SWP_TYPE_MASK); \
754 BUILD_BUG_ON(_PAGE_HPTEFLAGS & _PAGE_SWP_SOFT_DIRTY); \
755 } while (0)
756
757 #define SWP_TYPE_BITS 5
758 #define SWP_TYPE_MASK ((1UL << SWP_TYPE_BITS) - 1)
759 #define __swp_type(x) ((x).val & SWP_TYPE_MASK)
760 #define __swp_offset(x) (((x).val & PTE_RPN_MASK) >> PAGE_SHIFT)
761 #define __swp_entry(type, offset) ((swp_entry_t) { \
> 762 ((type) | (((offset) << PAGE_SHIFT) & PTE_RPN_MASK)})
763 /*
764 * swp_entry_t must be independent of pte bits. We build a swp_entry_t from
765 * swap type and offset we get from swap and convert that to pte to find a
766 * matching pte in linux page table.
767 * Clear bits not found in swap entries here.
768 */
769 #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val((pte)) & ~_PAGE_PTE })
770 #define __swp_entry_to_pte(x) __pte((x).val | _PAGE_PTE)
771 #define __pmd_to_swp_entry(pmd) (__pte_to_swp_entry(pmd_pte(pmd)))
772 #define __swp_entry_to_pmd(x) (pte_pmd(__swp_entry_to_pte(x)))
773

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx