[PATCH] ppc64: Thermal control for SMU based machines

Andrew Morton akpm at osdl.org
Wed Oct 12 10:13:15 EST 2005


Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:
>
> +#define BUILD_SHOW_FUNC_FIX(name, data)				\
> +static ssize_t show_##name(struct device *dev,                  \
> +			   struct device_attribute *attr,       \
> +			   char *buf)	                        \
> +{								\
> +	ssize_t r;						\
> +        s32 val = 0;                                            \
> +        data->ops->get_value(data, &val);                       \
> +	r = sprintf(buf, "%d.%03d", FIX32TOPRINT(val)); 	\
> +	return r;						\
> +}                                                               \
> +static DEVICE_ATTR(name,S_IRUGO,show_##name, NULL);
> +
> +
> +#define BUILD_SHOW_FUNC_INT(name, data)				\
> +static ssize_t show_##name(struct device *dev,                  \
> +			   struct device_attribute *attr,       \
> +			   char *buf)	                        \
> +{								\
> +        s32 val = 0;                                            \
> +        data->ops->get_value(data, &val);                       \
> +	return sprintf(buf, "%d", val);  			\
> +}                                                               \

Someone needs a tab key ;)



More information about the Linuxppc64-dev mailing list