lkml.org 
[lkml]   [2001]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] RFC: fix ethernet device initialization
Jes Sorensen wrote:
> I don't like the way you declare all the code in obscure macros in
> there.
>
> +#define DECLARE_CHG_MTU(suffix,low,high) \
> + static int suffix##_change_mtu(struct net_device *dev, int new_mtu) \
> ......
>
> All it does is to make the code harder to read and debug for little/no
> gain.

I disagree, but you probably knew that when you saw the code :)

These macros are not used inside code, they declare entire functions.
These functions are 100% duplicated across 2-4 protocols. Duplicated
code means bugs in some portions of the code and no others, more
difficult to maintain, etc. I even proved this point while developing
the patch -- one of the functions was missing an EXPORT_xxx symbol.
Using a standard macro automatically fixed this, a small oversight that
had been in the kernel probably for over a year.

--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.067 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site