netdev
[Top] [All Lists]

Re: [PATCH] NETIF_F_LLTX for devices 2

To: "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: Re: [PATCH] NETIF_F_LLTX for devices 2
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Sun, 12 Sep 2004 05:57:30 -0400
Cc: hadi@xxxxxxxxxx, ak@xxxxxxx, herbert@xxxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20040911174535.2acbb957.davem@xxxxxxxxxxxxx>
References: <20040908065152.GC27886@xxxxxxxxxxxxx> <E1C4wYe-0005qT-00@xxxxxxxxxxxxxxxxxxxxxxxx> <20040908072408.GI27886@xxxxxxxxxxxxx> <1094629677.1089.155.camel@xxxxxxxxxxxxxxxx> <20040908134713.1bcd46d3.davem@xxxxxxxxxxxxx> <1094823215.1121.129.camel@xxxxxxxxxxxxxxxx> <20040911142116.GL4431@xxxxxxxxxxxxx> <1094933731.2343.109.camel@xxxxxxxxxxxxxxxx> <20040911174535.2acbb957.davem@xxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Sat, Sep 11, 2004 at 05:45:35PM -0700, David S. Miller wrote:
> I think Andi made the right choice for his implementation.
> And frankly I don't what is worrying about the
> "-1" return value, it can occur in only one spot in a very
> specific controlled case and it's behavior is incredibly well
> defined (if not by accurate comments then by the code itself :-)

Not commenting on the overall issue, but just the return code:

We already have net drivers getting the current TWO return codes wrong.
Adding one more -magic number- to the mix is just plain silly.

1. Add constants
2. Add clear, unambiguous documentation describing all three return codes
3. (janitor) use constants

Lacking #1 and #2 are design flaws that ignore existing problems,
and create new ones.  Luckily #1 and #2 are simple, human-friendly
fixes.

        Jeff




<Prev in Thread] Current Thread [Next in Thread>