]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/starfire.c
drivers/net/wireless/b43: fix sparse warnings: make symbols static
[karo-tx-linux.git] / drivers / net / starfire.c
index d5b9dd842c619e9fbeef4a73f590cabbd3129ac2..f54ac2389da29dd444395853582c5153a55309e9 100644 (file)
@@ -880,9 +880,9 @@ static int mdio_read(struct net_device *dev, int phy_id, int location)
        void __iomem *mdio_addr = np->base + MIICtrl + (phy_id<<7) + (location<<2);
        int result, boguscnt=1000;
        /* ??? Should we add a busy-wait here? */
-       do
+       do {
                result = readl(mdio_addr);
-       while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
+       while ((result & 0xC0000000) != 0x80000000 && --boguscnt > 0);
        if (boguscnt == 0)
                return 0;
        if ((result & 0xffff) == 0xffff)
@@ -1503,6 +1503,11 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                desc->status = 0;
                np->rx_done = (np->rx_done + 1) % DONE_Q_SIZE;
        }
+
+       if (*quota == 0) {      /* out of rx quota */
+               retcode = 1;
+               goto out;
+       }
        writew(np->rx_done, np->base + CompletionQConsumerIdx);
 
  out: