a2065: skb_padto cleanups
Remove unnecessary check (skb_padto does the same check) Remove unnecessary duplicate variable Remove unnecessary clearing of padded part of skb. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
af4330631c
commit
cedc1dba74
@ -552,18 +552,13 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
struct lance_private *lp = netdev_priv(dev);
|
struct lance_private *lp = netdev_priv(dev);
|
||||||
volatile struct lance_regs *ll = lp->ll;
|
volatile struct lance_regs *ll = lp->ll;
|
||||||
volatile struct lance_init_block *ib = lp->init_block;
|
volatile struct lance_init_block *ib = lp->init_block;
|
||||||
int entry, skblen, len;
|
int entry, skblen;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
skblen = skb->len;
|
if (skb_padto(skb, ETH_ZLEN))
|
||||||
len = skblen;
|
return 0;
|
||||||
|
skblen = max_t(unsigned, skb->len, ETH_ZLEN);
|
||||||
if (len < ETH_ZLEN) {
|
|
||||||
len = ETH_ZLEN;
|
|
||||||
if (skb_padto(skb, ETH_ZLEN))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
|
||||||
@ -586,15 +581,11 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
entry = lp->tx_new & lp->tx_ring_mod_mask;
|
entry = lp->tx_new & lp->tx_ring_mod_mask;
|
||||||
ib->btx_ring [entry].length = (-len) | 0xf000;
|
ib->btx_ring [entry].length = (-skblen) | 0xf000;
|
||||||
ib->btx_ring [entry].misc = 0;
|
ib->btx_ring [entry].misc = 0;
|
||||||
|
|
||||||
skb_copy_from_linear_data(skb, (void *)&ib->tx_buf [entry][0], skblen);
|
skb_copy_from_linear_data(skb, (void *)&ib->tx_buf [entry][0], skblen);
|
||||||
|
|
||||||
/* Clear the slack of the packet, do I need this? */
|
|
||||||
if (len != skblen)
|
|
||||||
memset ((void *) &ib->tx_buf [entry][skblen], 0, len - skblen);
|
|
||||||
|
|
||||||
/* Now, give the packet to the lance */
|
/* Now, give the packet to the lance */
|
||||||
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
|
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
|
||||||
lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
|
lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
|
||||||
|
Loading…
Reference in New Issue
Block a user