[2/3][PATCH][upstream] TDM Framework

Scott Wood scottwood at freescale.com
Fri Jul 27 08:09:17 EST 2012


On 07/26/2012 04:28 PM, Timur Tabi wrote:
> Michael Ellerman wrote:
>> And the bible, K & R, includes an example of an enum which explicitly
>> specifies all its values. It goes on to say "enumeration variables offer
>> the chance of [type] checking and so are often better than #defines".
> 
> I don't want to beat a dead horse here, but if the driver doesn't do enum
> type checking, then it's hard to justify using an enum.

Enum symbols show up in a debugger, which is nice.  Why use the
preprocessor for something that can be just as well expressed in the
language itself?  The only real argument for #define in this case is
style, which in Linux does tend toward favoring #define.

-Scott




More information about the Linuxppc-dev mailing list