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
pgp00000.pgp
Description: PGP signature