Messages in this thread | | | Date | Tue, 7 Jan 2014 16:03:46 +0100 | From | Jean Delvare <> | Subject | Re: [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
| |