netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Joe Perches <joe@perches.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: Re: net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functions
Date: Tue, 23 Jun 2009 18:26:36 +0200	[thread overview]
Message-ID: <4A41023C.8040000@trash.net> (raw)
In-Reply-To: <1245774088.29098.10.camel@Joe-Laptop.home>

[-- Attachment #1: Type: text/plain, Size: 656 bytes --]

Joe Perches wrote:
> On Tue, 2009-06-23 at 18:03 +0200, Patrick McHardy wrote:
>> This patch is the result of an automatic spatch transformation to
>> convert all ndo_start_xmit() return values of 0 to NETDEV_TX_OK.
> 
> It might be useful if you submitted the spatch source
> that created this transformation.

I would have added it to the changelog, but it includes some workarounds
for false-negatives since the version used in Debian seems to be buggy.
Namely, it didn't manage to find occurences if there was only one, so I
included a number of NOP transformations to work around that. Or maybe
I'm doing something wrong :)

Attached for reference.



[-- Attachment #2: netdev.spatch --]
[-- Type: text/plain, Size: 501 bytes --]

@ ndomatch @
identifier ndo, xmit;
@@

struct net_device_ops ndo = {
	.ndo_start_xmit		= xmit,
};

@forall@
identifier skb, dev;
identifier ndomatch.xmit;
@@

int xmit(struct sk_buff *skb, struct net_device *dev)
{
...
(
-	return 1;
+	return NETDEV_TX_BUSY;
|
-	return -1;
+	return NETDEV_TX_LOCKED;
|
-	return 0;
+	return NETDEV_TX_OK;
|
-	return NETDEV_TX_BUSY;
+	return NETDEV_TX_BUSY;
|
-	return NETDEV_TX_LOCKED;
+	return NETDEV_TX_LOCKED;
|
-	return NETDEV_TX_OK;
+	return NETDEV_TX_OK;
)
...
}

  reply	other threads:[~2009-06-23 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 16:03 net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functions Patrick McHardy
2009-06-23 16:21 ` Joe Perches
2009-06-23 16:26   ` Patrick McHardy [this message]
2009-06-23 23:42 ` David Miller
2009-07-06  2:47 ` David Miller

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=4A41023C.8040000@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=joe@perches.com \
    --cc=netdev@vger.kernel.org \
    /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).