[PATCH v2 04/10] staging: ks7010: Rename jump labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 10 Aug 2016 17:57:50 +0200

Adjust jump targets according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
v2: Rebased on the source files from Linux next-20160809.

    Touched four source code places less.

 drivers/staging/ks7010/ks7010_sdio.c | 73 +++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9b954cb..53df8f7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -523,18 +523,18 @@ static void ks7010_rw_function(struct work_struct *work)
 			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
 					   &priv->ks_wlan_hw.rw_wq, 1);
 		}
-		goto err_out;
+		goto release_host;
 	}
 
 	/* sleep mode doze */
 	if (atomic_read(&priv->sleepstatus.doze_request) == 1) {
 		ks_wlan_hw_sleep_doze_request(priv);
-		goto err_out;
+		goto release_host;
 	}
 	/* sleep mode wakeup */
 	if (atomic_read(&priv->sleepstatus.wakeup_request) == 1) {
 		ks_wlan_hw_sleep_wakeup_request(priv);
-		goto err_out;
+		goto release_host;
 	}
 
 	/* read (WriteStatus/ReadDataSize FN1:00_0014) */
@@ -543,7 +543,7 @@ static void ks7010_rw_function(struct work_struct *work)
 	if (retval) {
 		DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,
 			atomic_read(&priv->psstatus.status));
-		goto err_out;
+		goto release_host;
 	}
 	DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
 
@@ -555,8 +555,7 @@ static void ks7010_rw_function(struct work_struct *work)
 		tx_device_task((void *)priv);
 	}
 	_ks_wlan_hw_power_save(priv);
-
- err_out:
+ release_host:
 	sdio_release_host(priv->ks_wlan_hw.sdio_card->func);
 
 	return;
@@ -720,15 +719,13 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
 	retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
 	if (retval) {
 		rc = 2;
-		goto error_out;
+		goto free_buf;
 	}
 
 	retval = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
-	if (retval) {
+	if (retval)
 		rc = 3;
-		goto error_out;
-	}
- error_out:
+ free_buf:
 	kfree(data_buf);
 	return rc;
 }
@@ -748,16 +745,15 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
 	retval = ks7010_sdio_read(priv, address, read_buf, size);
 	if (retval) {
 		rc = 2;
-		goto error_out;
+		goto free_buf;
 	}
 	retval = memcmp(data, read_buf, size);
 
 	if (retval) {
 		DPRINTK(0, "data compare error (%d) \n", retval);
 		rc = 3;
-		goto error_out;
 	}
- error_out:
+ free_buf:
 	kfree(read_buf);
 	return rc;
 }
@@ -784,7 +780,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 	if (rw_data == GCR_A_RUN) {
 		DPRINTK(0, "MAC firmware running ...\n");
 		rc = 0;
-		goto error_out0;
+		goto release_host;
 	}
 
 	retval = request_firmware(&fw_entry, ROM_FILE, &priv->ks_wlan_hw.sdio_card->func->dev);
@@ -814,14 +810,14 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 					     KS7010_IRAM_ADDRESS + offset);
 		if (retval) {
 			rc = 6;
-			goto error_out1;
+			goto release_fw;
 		}
 
 		/* Write data */
 		retval = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
 		if (retval) {
 			rc = 8;
-			goto error_out1;
+			goto release_fw;
 		}
 
 		/* compare */
@@ -829,7 +825,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 		    ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
 		if (retval) {
 			rc = 9;
-			goto error_out1;
+			goto release_fw;
 		}
 		n += size;
 
@@ -840,7 +836,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 	retval = ks7010_sdio_write(priv, GCR_A, &rw_data, sizeof(rw_data));
 	if (retval) {
 		rc = 11;
-		goto error_out1;
+		goto release_fw;
 	}
 	DPRINTK(4, " REMAP Request : GCR_A=%02X\n", rw_data);
 
@@ -851,7 +847,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 		    ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
 		if (retval) {
 			rc = 11;
-			goto error_out1;
+			goto release_fw;
 		}
 		if (rw_data == GCR_A_RUN)
 			break;
@@ -860,14 +856,13 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
 	if ((50) <= n) {
 		DPRINTK(1, "firmware can't start\n");
 		rc = 12;
-		goto error_out1;
+		goto release_fw;
 	}
 
 	rc = 0;
-
- error_out1:
+ release_fw:
 	release_firmware(fw_entry);
- error_out0:
+ release_host:
 	sdio_release_host(card->func);
 	kfree(rom_buf);
 	return rc;
@@ -994,20 +989,20 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	ret = sdio_enable_func(func);
 	DPRINTK(5, "sdio_enable_func() %d\n", ret);
 	if (ret)
-		goto error_free_card;
+		goto free_card;
 
 	/* interrupt disable */
 	sdio_writeb(func, 0, INT_ENABLE, &ret);
 	if (ret)
-		goto error_free_card;
+		goto free_card;
 	sdio_writeb(func, 0xff, INT_PENDING, &ret);
 	if (ret)
-		goto error_disable_func;
+		goto disable_func;
 
 	/* setup interrupt handler */
 	ret = sdio_claim_irq(func, ks_sdio_interrupt);
 	if (ret)
-		goto error_disable_func;
+		goto disable_func;
 
 	sdio_release_host(func);
 
@@ -1020,11 +1015,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	netdev = alloc_etherdev(sizeof(*priv));
 	if (netdev == NULL) {
 		printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
-		goto error_release_irq;
+		goto release_irq;
 	}
 	if (dev_alloc_name(netdev, "wlan%d") < 0) {
 		printk(KERN_ERR "ks7010 :  Couldn't get name!\n");
-		goto error_free_netdev;
+		goto free_dev;
 	}
 
 	priv = netdev_priv(netdev);
@@ -1038,7 +1033,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	priv->ks_wlan_hw.read_buf = NULL;
 	priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
 	if (!priv->ks_wlan_hw.read_buf) {
-		goto error_free_netdev;
+		goto free_dev;
 	}
 	priv->dev_state = DEVICE_STATE_PREBOOT;
 	priv->net_dev = netdev;
@@ -1066,7 +1061,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 		printk(KERN_ERR
 		       "ks7010: firmware load failed !! retern code = %d\n",
 		       ret);
-		goto error_free_read_buf;
+		goto free_buf;
 	}
 
 	/* interrupt setting */
@@ -1094,7 +1089,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 	priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq");
 	if (!priv->ks_wlan_hw.ks7010sdio_wq) {
 		DPRINTK(1, "create_workqueue failed !!\n");
-		goto error_free_read_buf;
+		goto free_buf;
 	}
 
 	INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function);
@@ -1102,22 +1097,22 @@ static int ks7010_sdio_probe(struct sdio_func *func,
 
 	ret = register_netdev(priv->net_dev);
 	if (ret)
-		goto error_free_read_buf;
+		goto free_buf;
 
 	return 0;
 
- error_free_read_buf:
+ free_buf:
 	kfree(priv->ks_wlan_hw.read_buf);
 	priv->ks_wlan_hw.read_buf = NULL;
- error_free_netdev:
+ free_dev:
 	free_netdev(priv->net_dev);
 	card->priv = NULL;
- error_release_irq:
+ release_irq:
 	sdio_claim_host(func);
 	sdio_release_irq(func);
- error_disable_func:
+ disable_func:
 	sdio_disable_func(func);
- error_free_card:
+ free_card:
 	sdio_release_host(func);
 	sdio_set_drvdata(func, NULL);
 	kfree(card);
-- 
2.9.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux