Re: [PATCH RFC] introduce pm_call() macro to get rid of most#ifdef CONFIG_PM

From: Pavel Machek
Date: Mon Mar 03 2008 - 09:45:57 EST


Hi!

> diff --git a/include/linux/pm.h b/include/linux/pm.h
> index 015b735..6e0b9c2 100644
> --- a/include/linux/pm.h
> +++ b/include/linux/pm.h
> @@ -114,6 +114,13 @@ typedef struct pm_message {
> int event;
> } pm_message_t;
>
> +#ifdef CONFIG_PM
> +#define pm_call(x) (x)
> +#else
> +/* avoid `defined but not used' warning */
> +#define pm_call(x) ((x) - 1 ? NULL : NULL)
> +#endif /* CONFIG_PM */
> +

This is evil. Maybe your gcc is smart enough to optimize this away,
but I'm not sure mine is.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/