lkml.org 
[lkml]   [2014]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] thermal: fix compilation issue on CONFIG_THERMAL_OF dependencies
On Tue, 07 Jan 2014 06:33:46 -0800, Guenter Roeck wrote:
> Alternative would be something like
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index f7e11c7..156bb4d 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -244,7 +244,7 @@ struct thermal_genl_event {
> };
>
> /* Function declarations */
> -#ifdef CONFIG_THERMAL_OF
> +#if defined(CONFIG_THERMAL_OF) && (defined(CONFIG_THERMAL) || (defined(MODULE) && defined(CONFIG_THERMAL_MODULE)))
> struct thermal_zone_device *
> thermal_zone_of_sensor_register(struct device *dev, int id,
> void *data, int (*get_temp)(void *, long *),

I don't like it. Using defined(MODULE) in a header file seems quite
risky (although I see there are occurrences of this already.) But more
importantly, this means that you can have all pieces enabled in your
kernel but the code will be silently stubbed out because the
combinations of Y and M happens to be unsupported but this is nowhere
documented. This is wrong.

--
Jean Delvare


\
 
 \ /
  Last update: 2014-01-07 17:01    [W:0.038 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site