From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: niklaus.giger@member.fsf.org
Cc: linux-kernel@vger.kernel.org, linuxppc-embedded@ozlabs.org,
kristen.c.accardi@intel.com
Subject: Re: [PATCH] Fix compilation for non CONFIG_HOTPLUG case
Date: Sun, 29 Jul 2007 20:45:34 +0400 [thread overview]
Message-ID: <46ACC42E.8040907@ru.mvista.com> (raw)
In-Reply-To: <200707291807.52042.niklaus.giger@member.fsf.org>
Hello.
Niklaus Giger wrote:
> Fixes compilation issues for embedded boards which do not support HOTPLUG
> Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 3599ab2..a09bfc8 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -24,7 +24,9 @@
> #include "base.h"
> #include "power/power.h"
>
> +#ifdef CONFIG_HOTPLUG
> extern const char *kobject_actions[];
> +#endif
No need for #ifdef around extern declarations.
> int (*platform_notify)(struct device * dev) = NULL;
> int (*platform_notify_remove)(struct device * dev) = NULL;
> @@ -306,11 +308,13 @@ static ssize_t store_uevent(struct device *dev, struct
> device_attribute *attr,
> const char *buf, size_t count)
> {
> size_t len = count;
> +#ifdef CONFIG_HOTPLUG
> enum kobject_action action;
> -
> +#endif
Please don't remove newline between the declaration block and the code.
> if (len && buf[len-1] == '\n')
> len--;
>
> +#ifdef CONFIG_HOTPLUG
> for (action = 0; action < KOBJ_MAX; action++) {
> if (strncmp(kobject_actions[action], buf, len) != 0)
> continue;
> @@ -319,11 +323,14 @@ static ssize_t store_uevent(struct device *dev, struct
> device_attribute *attr,
> kobject_uevent(&dev->kobj, action);
> goto out;
Grr... cleanup style abuse -- ISO a mere return they used goto. :-/
> }
> +#endif
>
> dev_err(dev, "uevent: unsupported action-string; this will "
> "be ignored in a future kernel version\n");
> kobject_uevent(&dev->kobj, KOBJ_ADD);
> +#ifdef CONFIG_HOTPLUG
> out:
> +#endif
Well, #ifdef'ing out label seems too much.
> return count;
> }
WBR, Sergei
next parent reply other threads:[~2007-07-29 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200707291807.52042.niklaus.giger@member.fsf.org>
2007-07-29 16:45 ` Sergei Shtylyov [this message]
2007-07-29 17:07 ` [PATCH] Fix compilation for non CONFIG_HOTPLUG case Gabriel C
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46ACC42E.8040907@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=kristen.c.accardi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-embedded@ozlabs.org \
--cc=niklaus.giger@member.fsf.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox