[PATCH v2 46/60] staging: ced1401: fix ced_check_self_test()

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

 



Rename camel case arguments and locals in function ced_check_self_test()

Signed-off-by: Luca Ellero <luca.ellero@xxxxxxxxxxxxxxxx>
---
 drivers/staging/ced1401/ced_ioc.c |   40 +++++++++++++++++++------------------
 drivers/staging/ced1401/usb1401.h |    3 ++-
 2 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c
index 44b4c6e..7e598e2 100644
--- a/drivers/staging/ced1401/ced_ioc.c
+++ b/drivers/staging/ced1401/ced_ioc.c
@@ -1045,31 +1045,31 @@ int ced_start_self_test(struct ced_data *ced)
 **
 ** Check progress of a self-test cycle
 ****************************************************************************/
-int ced_check_self_test(struct ced_data *ced, TGET_SELFTEST __user *pGST)
+int ced_check_self_test(struct ced_data *ced, TGET_SELFTEST __user *ugst)
 {
 	unsigned int state, error;
-	int iReturn;
+	int ret;
 	TGET_SELFTEST gst;	/*  local work space */
 	memset(&gst, 0, sizeof(gst));	/*  clear out the space (sets code 0) */
 
 	mutex_lock(&ced->io_mutex);
 
 	dev_dbg(&ced->interface->dev, "%s\n", __func__);
-	iReturn = ced_get_state(ced, &state, &error);
-	if (iReturn == U14ERR_NOERROR)	/*  Only accept zero if it happens twice */
-		iReturn = ced_get_state(ced, &state, &error);
+	ret = ced_get_state(ced, &state, &error);
+	if (ret == U14ERR_NOERROR) /* Only accept zero if it happens twice */
+		ret = ced_get_state(ced, &state, &error);
 
-	if (iReturn != U14ERR_NOERROR) {	/*  Self-test can cause comms errors */
+	if (ret != U14ERR_NOERROR) {	/*  Self-test can cause comms errors */
 				/*  so we assume still testing */
 		dev_err(&ced->interface->dev,
 			"%s: ced_get_state=%d, assuming still testing\n",
-			__func__, iReturn);
+			__func__, ret);
 		state = 0x80;	/*  Force still-testing, no error */
 		error = 0;
-		iReturn = U14ERR_NOERROR;
+		ret = U14ERR_NOERROR;
 	}
 
-	if ((state == -1) && (error == -1)) {	/*  If ced_get_state had problems */
+	if ((state == -1) && (error == -1)) {/* If ced_get_state had problems */
 		dev_err(&ced->interface->dev,
 			"%s: ced_get_state failed, assuming still testing\n",
 			__func__);
@@ -1079,14 +1079,15 @@ int ced_check_self_test(struct ced_data *ced, TGET_SELFTEST __user *pGST)
 
 	if ((state & 0xFF) == 0x80) {	/*  If we are still in self-test */
 		if (state & 0x00FF0000)	{ /*  Have we got an error? */
-			gst.code = (state & 0x00FF0000) >> 16;	/*  read the error code */
-			gst.x = error & 0x0000FFFF;	/*  Error data X */
-			gst.y = (error & 0xFFFF0000) >> 16;	/*  and data Y */
+			/* read the error code */
+			gst.code = (state & 0x00FF0000) >> 16;
+			gst.x = error & 0x0000FFFF;	    /* Error data X */
+			gst.y = (error & 0xFFFF0000) >> 16; /* and data Y   */
 			dev_dbg(&ced->interface->dev,
 				"Self-test error code %d\n", gst.code);
 		} else {		/*  No error, check for timeout */
-			unsigned long ulNow = jiffies;	/*  get current time */
-			if (time_after(ulNow, ced->self_test_time)) {
+			unsigned long now = jiffies;	/*  get current time */
+			if (time_after(now, ced->self_test_time)) {
 				gst.code = -2;	/*  Flag the timeout */
 				dev_dbg(&ced->interface->dev,
 					"Self-test timed-out\n");
@@ -1099,19 +1100,20 @@ int ced_check_self_test(struct ced_data *ced, TGET_SELFTEST __user *pGST)
 		dev_dbg(&ced->interface->dev, "Self-test done\n");
 	}
 
-	if (gst.code < 0) {	/*  If we have a problem or finished */
-				/*  If using the 2890 we should reset properly */
+	if (gst.code < 0) { /* If we have a problem or finished */
+			    /* If using the 2890 we should reset properly */
 		if ((ced->n_pipes == 4) && (ced->type <= TYPEPOWER))
 			ced_is_1401(ced);	/*  Get 1401 reset and OK */
 		else
-			ced_quick_check(ced, true, true);	/*  Otherwise check without reset unless problems */
+			/* Otherwise check without reset unless problems */
+			ced_quick_check(ced, true, true);
 	}
 	mutex_unlock(&ced->io_mutex);
 
-	if (copy_to_user(pGST, &gst, sizeof(gst)))
+	if (copy_to_user(ugst, &gst, sizeof(gst)))
 		return -EFAULT;
 
-	return iReturn;
+	return ret;
 }
 
 /****************************************************************************
diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h
index c5a4118..e1f1c54 100644
--- a/drivers/staging/ced1401/usb1401.h
+++ b/drivers/staging/ced1401/usb1401.h
@@ -241,7 +241,8 @@ extern int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *utx);
 extern int ced_kill_io(struct ced_data *ced);
 extern int ced_state_of_1401(struct ced_data *ced);
 extern int ced_start_self_test(struct ced_data *ced);
-extern int ced_check_self_test(struct ced_data *ced, TGET_SELFTEST __user *pGST);
+extern int ced_check_self_test(struct ced_data *ced,
+			       TGET_SELFTEST __user *ugst);
 extern int ced_type_of_1401(struct ced_data *ced);
 extern int ced_transfer_flags(struct ced_data *ced);
 extern int ced_dbg_peek(struct ced_data *ced, TDBGBLOCK __user *pDB);
-- 
1.7.10.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