[PATCH 2/3] staging: ks7010: rename identifier rc to ret

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

 



Function uses identifier 'rc' for the error return code to a function
call. Other places in the driver use 'ret' because it is more common
within the kernel. Local variable 'ret' does not need to be defined to
zero when it is declared. Function call site using 'ret' needs
refactoring, checkpatch emits WARNING: Avoid multiple line
dereference.

Rename rc -> ret. Move dereference to single line and correctly align
function arguments. Remove definition of 'ret' at declaration time.

Signed-off-by: Tobin C. Harding <me@xxxxxxxx>
---
 drivers/staging/ks7010/ks7010_sdio.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index b540be3..e25bd71 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -310,7 +310,7 @@ static void tx_device_task(void *dev)
 {
 	struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
 	struct tx_device_buffer *sp;
-	int rc = 0;
+	int ret;
 
 	DPRINTK(4, "\n");
 	if (cnt_txqbody(priv) <= 0 ||
@@ -319,13 +319,11 @@ static void tx_device_task(void *dev)
 
 	sp = &priv->tx_dev.tx_dev_buff[priv->tx_dev.qhead];
 	if (priv->dev_state >= DEVICE_STATE_BOOT) {
-		rc = write_to_device(priv, sp->sendp, sp->size);
-		if (rc) {
-			DPRINTK(1, "write_to_device error !!(%d)\n",
-				rc);
-			queue_delayed_work(priv->ks_wlan_hw.
-					ks7010sdio_wq,
-					&priv->ks_wlan_hw.rw_wq, 1);
+		ret = write_to_device(priv, sp->sendp, sp->size);
+		if (ret) {
+			DPRINTK(1, "write_to_device error !!(%d)\n", ret);
+			queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
+					   &priv->ks_wlan_hw.rw_wq, 1);
 			return;
 		}
 	}
-- 
2.7.4

_______________________________________________
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