Re: [LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread Russell Whitaker
On Sun, 6 Jan 2008, ron minnich wrote: > On Jan 6, 2008 1:43 PM, Juergen Beisert <[EMAIL PROTECTED]> wrote: > >> getCx86 and setCx86 defined as inline functions are working in all cases. So: >> Do not use macros as functions. > > That's a good point. It's easy to get fooled by macros. How about

Re: [LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread Carl-Daniel Hailfinger
On 06.01.2008 23:41, ron minnich wrote: > On Jan 6, 2008 1:43 PM, Juergen Beisert <[EMAIL PROTECTED]> wrote: > > >> getCx86 and setCx86 defined as inline functions are working in all cases. So: >> Do not use macros as functions. >> > > That's a good point. It's easy to get fooled by macros.

Re: [LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread ron minnich
On Jan 6, 2008 1:43 PM, Juergen Beisert <[EMAIL PROTECTED]> wrote: > getCx86 and setCx86 defined as inline functions are working in all cases. So: > Do not use macros as functions. That's a good point. It's easy to get fooled by macros. Thanks ron -- linuxbios mailing list linuxbios@linuxbios

Re: [LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread Juergen Beisert
On Sunday 06 January 2008 18:32, Carl-Daniel Hailfinger wrote: > How do we factor out such code? I prefer macros for simple function > wrappers and functions for multiline sequences. As we are working with hardware we should avoid any macros for function replacement. There are ugly side effects.

Re: [LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread ron minnich
On Jan 6, 2008 9:32 AM, Carl-Daniel Hailfinger <[EMAIL PROTECTED]> wrote: > How do we factor out such code? I prefer macros for simple function > wrappers and functions for multiline sequences. I spend a lot of time with Plan 9 code nowadays. These are the Bell Labs guys who invented it all. I am

[LinuxBIOS] [RFC] Macros vs. functions for better readability

2008-01-06 Thread Carl-Daniel Hailfinger
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 ris