linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
@ 2016-09-02  9:42 kbuild test robot
  2016-09-02 10:51 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2016-09-02  9:42 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: kbuild-all, linux-kernel, tipbuild, Sebastian Andrzej Siewior

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git smp/hotplug
head:   6dc465457fac9a49462bebbb870beea5d536b7c2
commit: cf95baff0dd05eaaf445f75217a3363d4f83b449 [4/8] cpu/hotplug: Add multi instance support
config: openrisc-or1ksim_defconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout cf95baff0dd05eaaf445f75217a3363d4f83b449
        # save the attached .config to linux build tree
        make.cross ARCH=openrisc 

All error/warnings (new ones prefixed by >>):

>> kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
>> kernel/cpu.c:1252:3: warning: missing braces around initializer
   kernel/cpu.c:1252:3: warning: (near initialization for 'cpuhp_bp_states[0].<anonymous>')
>> kernel/cpu.c:1253:3: error: unknown field 'teardown' specified in initializer
   kernel/cpu.c:1425:3: error: unknown field 'startup' specified in initializer
   kernel/cpu.c:1425:3: warning: missing braces around initializer
   kernel/cpu.c:1425:3: warning: (near initialization for 'cpuhp_ap_states[121].<anonymous>')
   kernel/cpu.c:1426:3: error: unknown field 'teardown' specified in initializer

vim +/startup +1252 kernel/cpu.c

68f4f1ec Max Krasnyansky 2008-05-29  1246  #endif /* CONFIG_SMP */
b8d317d1 Mike Travis     2008-07-24  1247  
cff7d378 Thomas Gleixner 2016-02-26  1248  /* Boot processor state steps */
cff7d378 Thomas Gleixner 2016-02-26  1249  static struct cpuhp_step cpuhp_bp_states[] = {
cff7d378 Thomas Gleixner 2016-02-26  1250  	[CPUHP_OFFLINE] = {
cff7d378 Thomas Gleixner 2016-02-26  1251  		.name			= "offline",
cff7d378 Thomas Gleixner 2016-02-26 @1252  		.startup		= NULL,
cff7d378 Thomas Gleixner 2016-02-26 @1253  		.teardown		= NULL,
cff7d378 Thomas Gleixner 2016-02-26  1254  	},
cff7d378 Thomas Gleixner 2016-02-26  1255  #ifdef CONFIG_SMP
cff7d378 Thomas Gleixner 2016-02-26  1256  	[CPUHP_CREATE_THREADS]= {

:::::: The code at line 1252 was first introduced by commit
:::::: cff7d378d3fdbb53db9b6e2578b14855f401cd41 cpu/hotplug: Convert to a state machine for the control processor

:::::: TO: Thomas Gleixner <tglx@linutronix.de>
:::::: CC: Thomas Gleixner <tglx@linutronix.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 7206 bytes --]

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

* Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
  2016-09-02  9:42 [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer kbuild test robot
@ 2016-09-02 10:51 ` Sebastian Andrzej Siewior
  2016-09-02 12:10   ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2016-09-02 10:51 UTC (permalink / raw)
  To: kbuild test robot; +Cc: Thomas Gleixner, kbuild-all, linux-kernel, tipbuild

On 2016-09-02 17:42:33 [+0800], kbuild test robot wrote:
> compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
> 
> >> kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
> >> kernel/cpu.c:1252:3: warning: missing braces around initializer
>    kernel/cpu.c:1252:3: warning: (near initialization for 'cpuhp_bp_states[0].<anonymous>')
> >> kernel/cpu.c:1253:3: error: unknown field 'teardown' specified in initializer
>    kernel/cpu.c:1425:3: error: unknown field 'startup' specified in initializer
>    kernel/cpu.c:1425:3: warning: missing braces around initializer
>    kernel/cpu.c:1425:3: warning: (near initialization for 'cpuhp_ap_states[121].<anonymous>')
>    kernel/cpu.c:1426:3: error: unknown field 'teardown' specified in initializer

This is a compiler issue. We have:
| struct cpuhp_step {
|         const char              *name;
|         union {
|                 int             (*startup)(unsigned int cpu);
|                 int             (*startup_multi)(unsigned int cpu,
|                                                  void *node);
|         };
…
| };
This unnamed union fields are valid as of ISO C11.
It seems that gcc 4.5 and earlier can't access ->startup. According to
[0] this is supported since gcc 4.6.

[0] https://gcc.gnu.org/wiki/C11Status

Sebastian

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

* Re: [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
  2016-09-02 10:51 ` Sebastian Andrzej Siewior
@ 2016-09-02 12:10   ` Thomas Gleixner
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Gleixner @ 2016-09-02 12:10 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: kbuild test robot, kbuild-all, linux-kernel, tipbuild

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

On Fri, 2 Sep 2016, Sebastian Andrzej Siewior wrote:
> On 2016-09-02 17:42:33 [+0800], kbuild test robot wrote:
> > compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
> > 
> > >> kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer
> > >> kernel/cpu.c:1252:3: warning: missing braces around initializer
> >    kernel/cpu.c:1252:3: warning: (near initialization for 'cpuhp_bp_states[0].<anonymous>')
> > >> kernel/cpu.c:1253:3: error: unknown field 'teardown' specified in initializer
> >    kernel/cpu.c:1425:3: error: unknown field 'startup' specified in initializer
> >    kernel/cpu.c:1425:3: warning: missing braces around initializer
> >    kernel/cpu.c:1425:3: warning: (near initialization for 'cpuhp_ap_states[121].<anonymous>')
> >    kernel/cpu.c:1426:3: error: unknown field 'teardown' specified in initializer
> 
> This is a compiler issue. We have:
> | struct cpuhp_step {
> |         const char              *name;
> |         union {
> |                 int             (*startup)(unsigned int cpu);
> |                 int             (*startup_multi)(unsigned int cpu,
> |                                                  void *node);
> |         };
> …
> | };
> This unnamed union fields are valid as of ISO C11.
> It seems that gcc 4.5 and earlier can't access ->startup. According to
> [0] this is supported since gcc 4.6.
> 
> [0] https://gcc.gnu.org/wiki/C11Status

And we have anon unions in other places as well. See
include/linux/spinlock_types.h

Thanks

	tglx

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

end of thread, other threads:[~2016-09-02 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-02  9:42 [tip:smp/hotplug 4/8] kernel/cpu.c:1252:3: error: unknown field 'startup' specified in initializer kbuild test robot
2016-09-02 10:51 ` Sebastian Andrzej Siewior
2016-09-02 12:10   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).