Re: [PATCH] Put braces around potentially empty 'if' body inhandle_pte_fault()

From: Alexey Dobriyan
Date: Sat Dec 17 2011 - 20:18:55 EST


On Sun, Dec 18, 2011 at 12:34:19AM +0000, Al Viro wrote:
> On Sun, Dec 18, 2011 at 01:18:55AM +0100, Eric Dumazet wrote:
> > Thats should be fixed in the reverse way :
> >
> > #define flush_tlb_fix_spurious_fault(vma, address) do { } while (0)
>
> There's a better way to do that -
> #define f(a) do { } while(0)
> does not work as a function returning void -
> f(1), g();
> won't work. OTOH
> #define f(a) ((void)0)
> works just fine.

Two words: static inline.
--
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/