diff options
author | Dave Jones <davej@redhat.com> | 2009-03-18 21:17:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-18 21:17:48 -0400 |
commit | cedc1dba74f481a632c5d5aedad0068d6ad945d8 (patch) | |
tree | d93c7a65ecd737dc16aa5fec4811cb5958dd0c4c /drivers/net/a2065.c | |
parent | af4330631cd48987755f1a8d324dc318f60cf16b (diff) |
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>
Diffstat (limited to 'drivers/net/a2065.c')
-rw-r--r-- | drivers/net/a2065.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 7a60bdd9a24..d0d0c2fee05 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -552,18 +552,13 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
552 | struct lance_private *lp = netdev_priv(dev); | 552 | struct lance_private *lp = netdev_priv(dev); |
553 | volatile struct lance_regs *ll = lp->ll; | 553 | volatile struct lance_regs *ll = lp->ll; |
554 | volatile struct lance_init_block *ib = lp->init_block; | 554 | volatile struct lance_init_block *ib = lp->init_block; |
555 | int entry, skblen, len; | 555 | int entry, skblen; |
556 | int status = 0; | 556 | int status = 0; |
557 | unsigned long flags; | 557 | unsigned long flags; |
558 | 558 | ||
559 | skblen = skb->len; | 559 | if (skb_padto(skb, ETH_ZLEN)) |
560 | len = skblen; | 560 | return 0; |
561 | 561 | skblen = max_t(unsigned, skb->len, ETH_ZLEN); | |
562 | if (len < ETH_ZLEN) { | ||
563 | len = ETH_ZLEN; | ||
564 | if (skb_padto(skb, ETH_ZLEN)) | ||
565 | return 0; | ||
566 | } | ||
567 | 562 | ||
568 | local_irq_save(flags); | 563 | local_irq_save(flags); |
569 | 564 | ||
@@ -586,15 +581,11 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
586 | } | 581 | } |
587 | #endif | 582 | #endif |
588 | entry = lp->tx_new & lp->tx_ring_mod_mask; | 583 | entry = lp->tx_new & lp->tx_ring_mod_mask; |
589 | ib->btx_ring [entry].length = (-len) | 0xf000; | 584 | ib->btx_ring [entry].length = (-skblen) | 0xf000; |
590 | ib->btx_ring [entry].misc = 0; | 585 | ib->btx_ring [entry].misc = 0; |
591 | 586 | ||
592 | skb_copy_from_linear_data(skb, (void *)&ib->tx_buf [entry][0], skblen); | 587 | skb_copy_from_linear_data(skb, (void *)&ib->tx_buf [entry][0], skblen); |
593 | 588 | ||
594 | /* Clear the slack of the packet, do I need this? */ | ||
595 | if (len != skblen) | ||
596 | memset ((void *) &ib->tx_buf [entry][skblen], 0, len - skblen); | ||
597 | |||
598 | /* Now, give the packet to the lance */ | 589 | /* Now, give the packet to the lance */ |
599 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); | 590 | ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); |
600 | lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask; | 591 | lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask; |