login
Header Space

 
 

Re: [RFC] x86: merge nmi_32-64 to nmi.c

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Cyrill Gorcunov <gorcunov@...>
Cc: Ingo Molnar <mingo@...>, H. Peter Anvin <hpa@...>, Thomas Gleixner <tglx@...>, LKML <linux-kernel@...>, Jiri Slaby <jirislaby@...>, Andi Kleen <andi@...>
Date: Saturday, May 17, 2008 - 4:28 pm

2008/5/17 Cyrill Gorcunov <gorcunov@gmail.com>:

Hi,

I've always wondered if it's cleaner to define variants of functions
like this with the conditionals inside the function, as opposed to one
big conditional encapsulating all these functions.  IMO, it's cleaner
to define the function with conditionals to define it's particular
behaviour in the two different cases, because that way there is one
definition of the function with both different behaviours inside,
e.g.:

static inline unsigned int get_nmi_count(int cpu)
{
#ifdef CONFIG_X86_64
        return cpu_pda(cpu)->__nmi_count;
#else
        return nmi_count(cpu);
#endif
}

I know it introduces a lot of these conditionals, but at least there
is one place to look for the get_nmi_count function, instead of
searching for all variants of the function.

Just a thought!

-- 
Regards,
Tom Spink
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sat May 17, 3:22 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Tom Spink, (Sat May 17, 4:28 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Maciej W. Rozycki, (Sat May 17, 4:52 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Thomas Gleixner, (Sat May 17, 5:40 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Andi Kleen, (Sun May 18, 6:15 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 6:20 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Andi Kleen, (Sun May 18, 6:25 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 6:29 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Tom Spink, (Sun May 18, 8:07 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 8:10 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Jeremy Fitzhardinge, (Sun May 18, 3:25 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Adrian Bunk, (Sun May 18, 2:08 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Maciej W. Rozycki, (Sun May 18, 2:38 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Adrian Bunk, (Sun May 18, 4:40 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Jeremy Fitzhardinge, (Sun May 18, 2:33 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Adrian Bunk, (Sun May 18, 3:29 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Jeremy Fitzhardinge, (Sun May 18, 3:51 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Andi Kleen, (Sun May 18, 2:13 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Jeremy Fitzhardinge, (Sun May 18, 2:35 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Andi Kleen, (Sun May 18, 3:13 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Mon May 19, 10:27 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Thomas Gleixner, (Sun May 18, 5:09 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 5:35 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 3:38 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Jeremy Fitzhardinge, (Sun May 18, 4:33 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 5:13 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 4:47 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Mikael Pettersson, (Sat May 17, 5:48 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Thomas Gleixner, (Sat May 17, 6:34 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Mon May 19, 2:07 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Mon May 19, 2:41 pm)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Wed May 21, 3:41 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 6:09 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 6:04 am)
Re: [RFC] x86: merge nmi_32-64 to nmi.c, Cyrill Gorcunov, (Sun May 18, 2:24 am)
speck-geostationary