]> err.no Git - linux-2.6/blobdiff - drivers/net/hp100.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[linux-2.6] / drivers / net / hp100.c
index 7ba87b7ee6126de8ccf91f4f6e897741e2c45bd5..dd1dc32dc98dc3181db5bb41be53f550bd3e1844 100644 (file)
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/io.h>
 
@@ -1486,11 +1487,8 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
        if (skb->len <= 0)
                return 0;
                
-       if (skb->len < ETH_ZLEN && lp->chip == HP100_CHIPID_SHASTA) {
-               skb = skb_padto(skb, ETH_ZLEN);
-               if (skb == NULL)
-                       return 0;
-       }
+       if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN))
+               return 0;
 
        /* Get Tx ring tail pointer */
        if (lp->txrtail->next == lp->txrhead) {
@@ -1499,7 +1497,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
                printk("hp100: %s: start_xmit_bm: No TX PDL available.\n", dev->name);
 #endif
                /* not waited long enough since last tx? */
-               if (jiffies - dev->trans_start < HZ)
+               if (time_before(jiffies, dev->trans_start + HZ))
                        return -EAGAIN;
 
                if (hp100_check_lan(dev))
@@ -1652,7 +1650,7 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
                printk("hp100: %s: start_xmit: tx free mem = 0x%x\n", dev->name, i);
 #endif
                /* not waited long enough since last failed tx try? */
-               if (jiffies - dev->trans_start < HZ) {
+               if (time_before(jiffies, dev->trans_start + HZ)) {
 #ifdef HP100_DEBUG
                        printk("hp100: %s: trans_start timing problem\n",
                               dev->name);