[U-Boot-Users] Patch to clean up syntax highlighting
Haavard Skinnemoen
haavard.skinnemoen at atmel.com
Sun Jun 15 16:56:56 CEST 2008
On Fri, 13 Jun 2008 08:14:17 -0400
Jerry Van Baren <gerald.vanbaren at ge.com> wrote:
> Looking at the source code, its pretty ugly already. Your change
> doesn't make it any more ugly and it could be argued that it is slightly
> less ugly (your patch removes the duplication of the "if( (...)"
> statement). I also don't see any alternative that would make the code
> beautiful. :-(
Actually, I think the following would be slightly cleaner:
#ifdef CONFIG_HAS_UID
# define HAS_UID (1)
#else
# define HAS_UID (0)
#endif
/* ... */
if (((strcmp (name, "serial#") == 0)
&& (!HAS_UID || (flag != 0xdeaf4add)))
|| ((strcmp (name, "ethaddr") == 0)
(I may have miscounted the parentheses though...I certainly see the
need for working syntax highlighting on this code ;-)
Haavard
More information about the U-Boot
mailing list