[PATCH] Updated Legacy code in arm csb336

Peter Dufault dufault at hda.com
Tue Jul 9 11:52:13 UTC 2013

On Jul 8, 2013, at 09:43 , Vipul Nayyar <nayyar_vipul at yahoo.com> wrote:

> /* Define this to use interrupt driver UART driver */
> #define USE_INTERRUPTS 1

( . . . )

> #if defined(USE_INTERRUPTS)

Personal observation:

I don't like using "#define USE_INTERRUPTS 1" in conjunction with "#if defined(USE_INTERRUPTS)".  Someone not too careful will change it to "#define USE_INTERRUPTS 0" and not understand why it is still being used.

I either use "#define USE_INTERRUPTS" (I know it is defined to be 1) or "#define USE_INTERRUPTS 1" (or 0) in conjunction with "#if USE_INTERRUPTS".  I use the second idiom in my own code, it also protects against typos such as "#if defined(USE_INTERUPTS)"

Peter Dufault
HD Associates, Inc.      Software and System Engineering

More information about the devel mailing list