Re: arch/s390/lib/uaccess.c:65:15: error: variable 'spec' has initializer but incomplete type
From: Janis Schoetterl-Glausch
Date: Mon Jan 24 2022 - 03:28:02 EST
On 1/22/22 09:42, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 9b57f458985742bd1c585f4c7f36d04634ce1143
> commit: 012a224e1fa31fc256aab921f691598e03db6018 s390/uaccess: introduce bit field for OAC specifier
> date: 5 days ago
> config: s390-randconfig-r033-20220120 (https://download.01.org/0day-ci/archive/20220122/202201221613.fgIWUw0F-lkp@xxxxxxxxx/config)
> compiler: s390-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=012a224e1fa31fc256aab921f691598e03db6018
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 012a224e1fa31fc256aab921f691598e03db6018
> # 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=s390 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> arch/s390/lib/uaccess.c: In function 'copy_from_user_mvcos':
>>> arch/s390/lib/uaccess.c:65:15: error: variable 'spec' has initializer but incomplete type
> 65 | union oac spec = {
> | ^~~
>>> arch/s390/lib/uaccess.c:66:18: error: 'union oac' has no member named 'oac2'
> 66 | .oac2.as = PSW_BITS_AS_SECONDARY,
> | ^~~~
> arch/s390/lib/uaccess.c:66:28: warning: excess elements in union initializer
> 66 | .oac2.as = PSW_BITS_AS_SECONDARY,
> | ^~~~~~~~~~~~~~~~~~~~~
> arch/s390/lib/uaccess.c:66:28: note: (near initialization for 'spec')
> arch/s390/lib/uaccess.c:67:18: error: 'union oac' has no member named 'oac2'
> 67 | .oac2.a = 1,
> | ^~~~
> arch/s390/lib/uaccess.c:67:27: warning: excess elements in union initializer
> 67 | .oac2.a = 1,
> | ^
> arch/s390/lib/uaccess.c:67:27: note: (near initialization for 'spec')
>>> arch/s390/lib/uaccess.c:65:19: error: storage size of 'spec' isn't known
> 65 | union oac spec = {
> | ^~~~
> arch/s390/lib/uaccess.c:65:19: warning: unused variable 'spec' [-Wunused-variable]
> arch/s390/lib/uaccess.c: In function 'copy_to_user_mvcos':
> arch/s390/lib/uaccess.c:142:15: error: variable 'spec' has initializer but incomplete type
> 142 | union oac spec = {
> | ^~~
>>> arch/s390/lib/uaccess.c:143:18: error: 'union oac' has no member named 'oac1'
> 143 | .oac1.as = PSW_BITS_AS_SECONDARY,
> | ^~~~
> arch/s390/lib/uaccess.c:143:28: warning: excess elements in union initializer
> 143 | .oac1.as = PSW_BITS_AS_SECONDARY,
> | ^~~~~~~~~~~~~~~~~~~~~
> arch/s390/lib/uaccess.c:143:28: note: (near initialization for 'spec')
> arch/s390/lib/uaccess.c:144:18: error: 'union oac' has no member named 'oac1'
> 144 | .oac1.a = 1,
> | ^~~~
> arch/s390/lib/uaccess.c:144:27: warning: excess elements in union initializer
> 144 | .oac1.a = 1,
> | ^
> arch/s390/lib/uaccess.c:144:27: note: (near initialization for 'spec')
> arch/s390/lib/uaccess.c:142:19: error: storage size of 'spec' isn't known
> 142 | union oac spec = {
> | ^~~~
> arch/s390/lib/uaccess.c:142:19: warning: unused variable 'spec' [-Wunused-variable]
> arch/s390/lib/uaccess.c: In function 'clear_user_mvcos':
> arch/s390/lib/uaccess.c:218:15: error: variable 'spec' has initializer but incomplete type
> 218 | union oac spec = {
> | ^~~
> arch/s390/lib/uaccess.c:219:18: error: 'union oac' has no member named 'oac1'
> 219 | .oac1.as = PSW_BITS_AS_SECONDARY,
> | ^~~~
> arch/s390/lib/uaccess.c:219:28: warning: excess elements in union initializer
> 219 | .oac1.as = PSW_BITS_AS_SECONDARY,
> | ^~~~~~~~~~~~~~~~~~~~~
> arch/s390/lib/uaccess.c:219:28: note: (near initialization for 'spec')
> arch/s390/lib/uaccess.c:220:18: error: 'union oac' has no member named 'oac1'
> 220 | .oac1.a = 1,
> | ^~~~
> arch/s390/lib/uaccess.c:220:27: warning: excess elements in union initializer
> 220 | .oac1.a = 1,
> | ^
> arch/s390/lib/uaccess.c:220:27: note: (near initialization for 'spec')
> arch/s390/lib/uaccess.c:218:19: error: storage size of 'spec' isn't known
> 218 | union oac spec = {
> | ^~~~
> arch/s390/lib/uaccess.c:218:19: warning: unused variable 'spec' [-Wunused-variable]
This is caused by the union definition being covered by the #ifdef CONFIG_HAVE_MARCH_Z10_FEATURES.