[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140608122713.1627.qmail@ns.horizon.com>
Date: 8 Jun 2014 08:27:13 -0400
From: "George Spelvin" <linux@...izon.com>
To: dborkman@...hat.com, linux@...izon.com
Cc: davem@...emloft.net, hannes@...essinduktion.org,
linux-kernel@...r.kernel.org, shemminger@...l.org, tytso@....edu
Subject: Re: [PATCH 3/7] lib/random32.c: Replace an #ifdef with a stub prandom_state_selftest()
>> #ifdef CONFIG_RANDOM32_SELFTEST
>> static void __init prandom_state_selftest(void);
>> +#else
>> +#define prandom_state_selftest() (void)0
> Fine by me. I think you can remove this '(void)0' here, though.
That's the standard way to write a no-op statement in C.
I seem to recall there's a reason that the empty string can cause problems
in some syntactic contexts, but I can't figure out what the situation is.
At first, I thought of the obvious:
if (condition)
prandom_state_selftest();
unconditional_code();
... but the semicolon makes that work. I'll try to remember
the reason.
(I know that nobody uses it in any such context, but it's
good manners to make a function-like macro behave as exactly
like a function as possible.)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists