[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <26046.1199598953@turing-police.cc.vt.edu>
Date: Sun, 06 Jan 2008 00:55:53 -0500
From: Valdis.Kletnieks@...edu
To: Miguel Botón <mboton.lkml@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>, tglx@...utronix.de
Subject: Re: [PATCH] x86: ioport_{32|64}.c unification
On Sun, 06 Jan 2008 02:20:45 +0100, Miguel =?utf-8?q?Bot=C3=B3n?= said:
> #ifdef CONFIG_X86_32
> asmlinkage long sys_iopl(unsigned long regsp)
> {
> volatile struct pt_regs *regs = (struct pt_regs *)®sp;
> unsigned int level = regs->bx;
> #else
> asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs)
> {
> #endif
> return do_iopl(level, (long *)®s->flags);
> }
That looks like an unholy marriage between the preprocessor, a function
definition, and a Duff Device. :)
Do it like this:
#ifdef CONFIG_X86_32
asmlinkage sys_iopl( prototype_needed)
{
/* the whole thing */
}
#else
asmlinkage long sys_iopl(alternate_prototype)
{
/* the entire body */
}
#endif
You'll still need some ad-croc ifdef-ery at the call site to make it use
the correct prototype (unless you can come up with some clever way of making
the two use the same prototype, possibly by passing a dummy argument on
some architectures...
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists