lkml.org 
[lkml]   [2005]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 2.6.14-rc4] orinoco: remove redundance skb length check before padding
Checking the skb->len value before calling skb_padto is redundant.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

drivers/net/wireless/orinoco.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -505,11 +505,9 @@ static int orinoco_xmit(struct sk_buff *

/* Check packet length, pad short packets, round up odd length */
len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
- if (skb->len < len) {
- skb = skb_padto(skb, len);
- if (skb == NULL)
- goto fail;
- }
+ skb = skb_padto(skb, len);
+ if (skb == NULL)
+ goto fail;
len -= ETH_HLEN;

eh = (struct ethhdr *)skb->data;
-
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-10-19 03:38    [W:0.062 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site