Skip to contentSkip to conversation

drivers/base/core.c broken for non-CONFIG_HOTPLUG

DISCUSSION Robert Schwebel 4 participants 5 messages Jul 20, 2007

lore
Share & tools
lore
#0 lore raw

Kay,

With commit 60a96a59569bab85571d0089682109bd3324e896, you broke drivers/base/core.c for systems which have not enabled CONFIG_HOTPLUG.

You add and use

	extern const char *kobject_actions[];

but the code in lib/kobject_uevent.c who actually brings in the code is only compiled when CONFIG_HOTPLUG is enabled.

Please send a fix.

Robert

Signature · 5 lines
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9
#1 lore raw
Quoted 5 lines · Robert Schwebel

Kay,

With commit 60a96a59569bab85571d0089682109bd3324e896, you broke drivers/base/core.c for systems which have not enabled CONFIG_HOTPLUG.

Quoted 8 lines

You add and use

	extern const char *kobject_actions[];

but the code in lib/kobject_uevent.c who actually brings in the code is only compiled when CONFIG_HOTPLUG is enabled.

Please send a fix.

Already known and reported, see lkml :)

Kay is at GUADEC right now and will provide a patch in a day or so, unless I beat him to it...

thanks,

greg k-h

#3 lore raw
Quoted 8 lines · Andrew Morton
Quoted 3 lines · On Fri, 20 Jul 2007 09:01:06 +0200 Robert Schwebel <[email protected]>…

You add and use

	extern const char *kobject_actions[];

Added it in a .c file, too. Even checkpatch.pl knows that was wrong.

The kernel is doing that all over the place for global symbols that are not meant to be used out of a "private" context or where a "private" header file of a subsystem doesn't exist.

I can change that, if this isn't the way to do it?

Thanks,
Kay

#4 lore raw
Quoted 5 lines · On Fri, 20 Jul 2007 14:06:19 +0200 Kay Sievers <[email protected]> wrote:
Quoted 4 lines · Andrew Morton
Quoted 2 lines · On Fri, 20 Jul 2007 09:01:06 +0200 Robert Schwebel <[email protected]>…

You add and use

Quoted 8 lines
Quoted 4 lines
Quoted 1 line
	extern const char *kobject_actions[];

Added it in a .c file, too. Even checkpatch.pl knows that was wrong.

The kernel is doing that all over the place for global symbols that are not meant to be used out of a "private" context or where a "private" header file of a subsystem doesn't exist.

Whatever the reason, it's still wrong, because the problem remains: lack of typechecking between the definition and its users.

It's defensible in one situation: where the definition is in assembly language. And even then the symbol can be declared in a header, if only because a second user may be added.

Quoted 1 line

I can change that, if this isn't the way to do it?

Please. Let's find a reasonably-relevant header for it. If there isn't one, let's add it; there are quite possibly other things which should be in that header so choose with care, with that possibility in mind.