[PATCH] suppress 'store_purr' unused warning

Anton Blanchard anton at samba.org
Thu Aug 5 08:58:07 EST 2004


Hi,

> Some new sysfs macros declare a store_purr() function that never gets
> used, which makes a compiler warning happen.  Suppress the warning with
> an unused attribute.

Looks good to me, but could you use the __attribute_used__ compiler.h
macro to guard against the ever changing gcc mind?

Anton

> Can you tell that I'm using compiler warnings heavily in my
> CONFIG_NONLINEAR debugging? :)
>
> -- Dave
>
>
>
>
> ---
>
>  memhotplug-dave/arch/ppc64/kernel/sysfs.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN arch/ppc64/kernel/sysfs.c~A3-ppc64-store_purr_unused arch/ppc64/kernel/sysfs.c
> --- memhotplug/arch/ppc64/kernel/sysfs.c~A3-ppc64-store_purr_unused	Tue Aug  3 01:15:51 2004
> +++ memhotplug-dave/arch/ppc64/kernel/sysfs.c	Tue Aug  3 01:17:17 2004
> @@ -209,8 +209,8 @@ static ssize_t show_##NAME(struct sys_de
>  	unsigned long val = run_on_cpu(cpu->sysdev.id, read_##NAME, 0); \
>  	return sprintf(buf, "%lx\n", val); \
>  } \
> -static ssize_t store_##NAME(struct sys_device *dev, const char *buf, \
> -			    size_t count) \
> +static ssize_t __attribute__((unused)) \
> +	store_##NAME(struct sys_device *dev, const char *buf, size_t count) \
>  { \
>  	struct cpu *cpu = container_of(dev, struct cpu, sysdev); \
>  	unsigned long val; \
>
> _


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list