mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francois Romieu <romieu@cogenit.fr>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 3/10
Date: Sun, 30 Jun 2002 17:19:12 +0200	[thread overview]
Message-ID: <20020630171912.E19347@fafner.intra.cogenit.fr> (raw)
In-Reply-To: <3D17743E.8060905@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Mon, Jun 24, 2002 at 03:34:22PM -0400

- (cosmetic) removal of unused variable (pad_allocated);
- (cosmetic) gotoize error paths in TLan_probe1. Extra benefit: code gets 
  correctly indented again.

--- linux-2.5.24/drivers/net/tlan.c	Sat Jun 29 22:15:10 2002
+++ linux-2.5.24/drivers/net/tlan.c	Sat Jun 29 22:25:22 2002
@@ -431,12 +431,9 @@ static struct pci_driver tlan_driver = {
 
 static int __init tlan_probe(void)
 {
-	static int	pad_allocated;
-	
 	printk(KERN_INFO "%s", tlan_banner);
 	
-	TLanPadBuffer = (u8 *) kmalloc(TLAN_MIN_FRAME_SIZE, 
-					GFP_KERNEL);
+	TLanPadBuffer = (u8 *) kmalloc(TLAN_MIN_FRAME_SIZE, GFP_KERNEL);
 
 	if (TLanPadBuffer == NULL) {
 		printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n");
@@ -447,7 +444,6 @@ static int __init tlan_probe(void)
 
 
 	memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE);
-	pad_allocated = 1;
 
 	TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n");
 	
@@ -505,7 +501,7 @@ static int __devinit TLan_probe1(struct 
 	TLanPrivateInfo    *priv;
 	u8		   pci_rev;
 	u16		   device_id;
-	int		   reg;
+	int		   reg, ret;
 
 	if (pdev && pci_enable_device(pdev))
 		return -EIO;
@@ -513,7 +509,8 @@ static int __devinit TLan_probe1(struct 
 	dev = init_etherdev(NULL, sizeof(TLanPrivateInfo));
 	if (dev == NULL) {
 		printk(KERN_ERR "TLAN: Could not allocate memory for device.\n");
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err_out;
 	}
 	SET_MODULE_OWNER(dev);
 	
@@ -537,9 +534,8 @@ static int __devinit TLan_probe1(struct 
 		}
 		if (!pci_io_base) {
 			printk(KERN_ERR "TLAN: No IO mappings available\n");
-			unregister_netdev(dev);
-			kfree(dev);
-			return -ENODEV;
+			ret = -ENODEV;
+			goto err_unregister_dev;
 		}
 		
 		dev->base_addr = pci_io_base;
@@ -594,10 +590,9 @@ static int __devinit TLan_probe1(struct 
 	
 	if (TLan_Init(dev)) {
 		printk(KERN_ERR "TLAN: Could not register device.\n");
-		unregister_netdev(dev);
-		kfree(dev);
-		return -EAGAIN;
-	} else {
+		ret = -EAGAIN;
+		goto err_unregister_dev;
+	}
 	
 	TLanDevicesInstalled++;
 	boards_found++;
@@ -618,8 +613,12 @@ static int __devinit TLan_probe1(struct 
 			priv->adapter->deviceLabel,
 			priv->adapterRev);
 	return 0;
-	}
 
+err_unregister_dev:
+	unregister_netdev(dev);
+	kfree(dev);
+err_out:
+	return ret;
 }
 
 static void TLan_Release_Dev(struct net_device *dev)

  parent reply	other threads:[~2002-06-30 15:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-24  2:34 [PATCH] 2.5.24 : drivers/net/tlan.c Frank Davis
2002-06-24  6:43 ` Francois Romieu
2002-06-24 19:14   ` [PATCH] 2.5.24 : drivers/net/tlan.c; drivers/net/rrunner.c Francois Romieu
2002-06-24 19:34     ` Jeff Garzik
2002-06-24 20:59       ` Dave Jones
2002-06-30 15:18       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 0/10 Francois Romieu
2002-06-30 15:18       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 1/10 Francois Romieu
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 2/10 Francois Romieu
2002-06-30 15:19       ` Francois Romieu [this message]
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 4/10 Francois Romieu
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 5/10 Francois Romieu
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 6/10 Francois Romieu
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 7/10 Francois Romieu
2002-06-30 15:19       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 8/10 Francois Romieu
2002-06-30 15:20       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 9/10 Francois Romieu
2002-06-30 15:20       ` [PATCH] 2.5.24 - drivers/net/tlan.c dma mapping 10/10 Francois Romieu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020630171912.E19347@fafner.intra.cogenit.fr \
    --to=romieu@cogenit.fr \
    --cc=jgarzik@mandrakesoft.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®