lkml.org 
[lkml]   [2004]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Dri-devel] 2.6 kernel change in nopage
On Thu, Jan 01, 2004 at 01:23:40PM +0100, Michel Dänzer wrote:
> > > How does this patch look?
> >
> > ugly.
> >
> > I find using #defines for function arguments ugly beyond belief and
> > makes it really hard to look through code. I 10x rather have an ifdef in
> > the function prototype (which then for the mainstream kernel drm can be
> > removed for non-matching versions) than such obfuscation.
>
> That doesn't strike me as particularly beautiful either...

well the advantage is that the ifdefs can just go away in kernel trees of
specific versions... (eg unifdef it)

> is it really easier for merges, considering that the ugly way is kinda
> needed for functions which take different arguments on BSD anyway?

I disagree there. The "BSD takes different arguments" thing *should* be
fixed imo by making the common core of the function an inline function, and have
one or two (depends if the common core happens to have its arguments in common
with one of the oses) OS specific wrappers with the right prototype. This
way the difference in error return sign can also be solved in the wrapper
instead of with a nasty macro...

The compiler generates the same code, but it's a lot easier to read/review.

Greetings,
Arjan van de Ven
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:59    [W:1.137 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site