linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Jes Sorensen <jes@linuxcare.com>
Cc: Linux Knernel Mailing List <linux-kernel@vger.kernel.org>,
	netdev@oss.sgi.com
Subject: Re: [PATCH] RFC: fix ethernet device initialization
Date: Sat, 10 Mar 2001 22:25:38 -0500	[thread overview]
Message-ID: <3AAAF032.24AC716D@mandrakesoft.com> (raw)
In-Reply-To: <3AA6A570.57FF2D36@mandrakesoft.com> <d3ofvcyxhh.fsf@lxplus012.cern.ch>

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

      reply	other threads:[~2001-03-11  3:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-07 21:17 [PATCH] RFC: fix ethernet device initialization Jeff Garzik
2001-03-07 21:23 ` Jeff Garzik
2001-03-07 21:41   ` Arjan van de Ven
2001-03-07 22:16 ` Jeff Garzik
2001-03-07 23:13 ` Andrew Morton
2001-03-07 23:23   ` Alan Cox
2001-03-08 17:35 ` Jes Sorensen
2001-03-11  3:25   ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AAAF032.24AC716D@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=jes@linuxcare.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).