lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 29 Jul 2007 20:45:34 +0400
From:	Sergei Shtylyov <sshtylyov@...mvista.com>
To:	niklaus.giger@...ber.fsf.org
Cc:	linux-kernel@...r.kernel.org, linuxppc-embedded@...abs.org,
	kristen.c.accardi@...el.com
Subject: Re: [PATCH] Fix compilation for non CONFIG_HOTPLUG case

Hello.

Niklaus Giger wrote:

> Fixes compilation issues for embedded boards which do not support HOTPLUG

> Signed-off-by: Niklaus Giger <niklaus.giger@...ber.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ