Commit cd030c4cb3ee0cd4f0589a5f723d358cca1f7a9a

Authored by Cornelia Huck
Committed by Greg Kroah-Hartman
1 parent 8b43626f0c

kobject: fix link error when CONFIG_HOTPLUG is disabled

Leaving kobject_actions[] in kobject_uevent.c, but putting it outside
the #ifdef looks indeed like the best solution to me. This way, we
avoid adding #ifdef CONFIG_HOTPLUG into core.c, when all other
functions called do not need such a thing.


Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff

lib/kobject_uevent.c
... ... @@ -25,14 +25,6 @@
25 25 #define BUFFER_SIZE 2048 /* buffer for the variables */
26 26 #define NUM_ENVP 32 /* number of env pointers */
27 27  
28   -#if defined(CONFIG_HOTPLUG)
29   -u64 uevent_seqnum;
30   -char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
31   -static DEFINE_SPINLOCK(sequence_lock);
32   -#if defined(CONFIG_NET)
33   -static struct sock *uevent_sock;
34   -#endif
35   -
36 28 /* the strings here must match the enum in include/linux/kobject.h */
37 29 const char *kobject_actions[] = {
38 30 "add",
... ... @@ -42,6 +34,14 @@
42 34 "online",
43 35 "offline",
44 36 };
  37 +
  38 +#if defined(CONFIG_HOTPLUG)
  39 +u64 uevent_seqnum;
  40 +char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
  41 +static DEFINE_SPINLOCK(sequence_lock);
  42 +#if defined(CONFIG_NET)
  43 +static struct sock *uevent_sock;
  44 +#endif
45 45  
46 46 /**
47 47 * kobject_uevent_env - send an uevent with environmental data