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

From: David Brownell
Date: Mon Mar 03 2008 - 17:56:52 EST


On Monday 03 March 2008, Pavel Machek wrote:
> > +/* avoid `defined but not used' warning */
> > +#define pm_call(x) ((x) - 1 ? NULL : NULL)
> > +#endif /* CONFIG_PM */
> > +
>
> This is evil.

Ugly, yes. It might merit some casts too.


> Maybe your gcc is smart enough to optimize this away,
> but I'm not sure mine is.

It'll be a constant expression; it certainly ought to be.

--
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/