[LinuxBIOS] [RFC] Macros vs. functions for better readability
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Sun Jan 6 18:32:10 CET 2008
Hi,
it seems we sometimes have lots of repetitive code sequences which could
be simplified by use of macros or functions. For a really shining
example see Torsten Duwe's recent patch titled "beautify m57sli mptable.c".
Cut-and-paste errors can happen and eliminating repetitive code reduces
the risk of such errors. Besides that, having code with shorter lines
through factoring out open-coded functions makes understanding the code
easier.
How do we factor out such code? I prefer macros for simple function
wrappers and functions for multiline sequences.
Comments?
Regards,
Carl-Daniel
More information about the coreboot
mailing list