aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-03-21 13:57:05 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-21 16:00:51 -0500
commit203babb650d0c99a8be08f479d4a05d420988d89 (patch)
treea573eab0062e1f24eef9c3b063a31a310fa6f192 /drivers/net
parentc68ce71a340ffb5c589db5d9f9af1ce4ef81baa9 (diff)
[PATCH] skge: formmating and whitespace cleanup
Reformat some code to make it easier to read. And whitespace fixes. Signed-off-by: Stephen Hemminger <sheminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/skge.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 8c674cdecd7b..7f8e8dd0fc6e 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2177,15 +2177,17 @@ static int skge_up(struct net_device *dev)
2177 2177
2178 memset(skge->mem, 0, skge->mem_size); 2178 memset(skge->mem, 0, skge->mem_size);
2179 2179
2180 if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) 2180 err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma);
2181 if (err)
2181 goto free_pci_mem; 2182 goto free_pci_mem;
2182 2183
2183 err = skge_rx_fill(skge); 2184 err = skge_rx_fill(skge);
2184 if (err) 2185 if (err)
2185 goto free_rx_ring; 2186 goto free_rx_ring;
2186 2187
2187 if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, 2188 err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size,
2188 skge->dma + rx_size))) 2189 skge->dma + rx_size);
2190 if (err)
2189 goto free_rx_ring; 2191 goto free_rx_ring;
2190 2192
2191 skge->tx_avail = skge->tx_ring.count - 1; 2193 skge->tx_avail = skge->tx_ring.count - 1;
@@ -2308,9 +2310,9 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
2308 return NETDEV_TX_OK; 2310 return NETDEV_TX_OK;
2309 2311
2310 if (!spin_trylock(&skge->tx_lock)) { 2312 if (!spin_trylock(&skge->tx_lock)) {
2311 /* Collision - tell upper layer to requeue */ 2313 /* Collision - tell upper layer to requeue */
2312 return NETDEV_TX_LOCKED; 2314 return NETDEV_TX_LOCKED;
2313 } 2315 }
2314 2316
2315 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { 2317 if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
2316 if (!netif_queue_stopped(dev)) { 2318 if (!netif_queue_stopped(dev)) {
@@ -2709,8 +2711,8 @@ static int skge_poll(struct net_device *dev, int *budget)
2709 if (control & BMU_OWN) 2711 if (control & BMU_OWN)
2710 break; 2712 break;
2711 2713
2712 skb = skge_rx_get(skge, e, control, rd->status, 2714 skb = skge_rx_get(skge, e, control, rd->status,
2713 le16_to_cpu(rd->csum2)); 2715 le16_to_cpu(rd->csum2));
2714 if (likely(skb)) { 2716 if (likely(skb)) {
2715 dev->last_rx = jiffies; 2717 dev->last_rx = jiffies;
2716 netif_receive_skb(skb); 2718 netif_receive_skb(skb);
@@ -3240,13 +3242,15 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3240 struct skge_hw *hw; 3242 struct skge_hw *hw;
3241 int err, using_dac = 0; 3243 int err, using_dac = 0;
3242 3244
3243 if ((err = pci_enable_device(pdev))) { 3245 err = pci_enable_device(pdev);
3246 if (err) {
3244 printk(KERN_ERR PFX "%s cannot enable PCI device\n", 3247 printk(KERN_ERR PFX "%s cannot enable PCI device\n",
3245 pci_name(pdev)); 3248 pci_name(pdev));
3246 goto err_out; 3249 goto err_out;
3247 } 3250 }
3248 3251
3249 if ((err = pci_request_regions(pdev, DRV_NAME))) { 3252 err = pci_request_regions(pdev, DRV_NAME);
3253 if (err) {
3250 printk(KERN_ERR PFX "%s cannot obtain PCI resources\n", 3254 printk(KERN_ERR PFX "%s cannot obtain PCI resources\n",
3251 pci_name(pdev)); 3255 pci_name(pdev));
3252 goto err_out_disable_pdev; 3256 goto err_out_disable_pdev;
@@ -3298,7 +3302,8 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3298 goto err_out_free_hw; 3302 goto err_out_free_hw;
3299 } 3303 }
3300 3304
3301 if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) { 3305 err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw);
3306 if (err) {
3302 printk(KERN_ERR PFX "%s: cannot assign irq %d\n", 3307 printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
3303 pci_name(pdev), pdev->irq); 3308 pci_name(pdev), pdev->irq);
3304 goto err_out_iounmap; 3309 goto err_out_iounmap;
@@ -3316,7 +3321,8 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3316 if ((dev = skge_devinit(hw, 0, using_dac)) == NULL) 3321 if ((dev = skge_devinit(hw, 0, using_dac)) == NULL)
3317 goto err_out_led_off; 3322 goto err_out_led_off;
3318 3323
3319 if ((err = register_netdev(dev))) { 3324 err = register_netdev(dev);
3325 if (err) {
3320 printk(KERN_ERR PFX "%s: cannot register net device\n", 3326 printk(KERN_ERR PFX "%s: cannot register net device\n",
3321 pci_name(pdev)); 3327 pci_name(pdev));
3322 goto err_out_free_netdev; 3328 goto err_out_free_netdev;