staging: ced1401: fix ced_handle_esc()

This change “staging: ced1401: fix ced_handle_esc()” (commit 13f9c56) in Linux kernel is authored by Luca Ellero <luca.ellero [at] brickedbrain.com> on Thu Jul 10 11:02:02 2014 +0200.

Description of "staging: ced1401: fix ced_handle_esc()"

The change “staging: ced1401: fix ced_handle_esc()” introduces changes as follows.

staging: ced1401: fix ced_handle_esc()

Rename camel case arguments and locals in function ced_handle_esc()

Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 13f9c56

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "staging: ced1401: fix ced_handle_esc()"

There are 41 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/ced1401/usb1401.c | 41 +++++++++++++++++--------------
 1 file changed, 22 insertions(+), 19 deletions(-)
 
diff --git a/drivers/staging/ced1401/usb1401.c b/drivers/staging/ced1401/usb1401.c
index f360896bb9a9..f47735f2d7bc 100644
--- a/drivers/staging/ced1401/usb1401.c
+++ b/drivers/staging/ced1401/usb1401.c
@@ -1122,25 +1122,28 @@ static bool ced_read_dma_info(volatile struct dmadesc *dma_desc,
 **
 ** Parameters are
 **
-** dwCount - the number of characters in the device extension char in buffer,
+** count - the number of characters in the device extension char in buffer,
 **           this is known to be at least 2 or we will not be called.
 **
 ****************************************************************************/
-static int ced_handle_esc(struct ced_data *ced, char *pCh,
-			 unsigned int dwCount)
+static int ced_handle_esc(struct ced_data *ced, char *ch,
+			 unsigned int count)
 {
-	int iReturn = U14ERR_FAIL;
+	int retval = U14ERR_FAIL;
 
-	/*  I have no idea what this next test is about. '?' is 0x3f, which is area 3, code */
-	/*  15. At the moment, this is not used, so it does no harm, but unless someone can */
-	/*  tell me what this is for, it should be removed from this and the Windows driver. */
-	if (pCh[0] == '?') {	/*  Is this an information response */
+	/* I have no idea what this next test is about. '?' is 0x3f, which is */
+	/* area 3, code 15. At the moment, this is not used, so it does no    */
+	/* harm, but unless someone can tell me what this is for, it should   */
+	/* be removed from this and the Windows driver. */
+	if (ch[0] == '?') {	/*  Is this an information response */
 				/*  Parse and save the information */
 	} else {
 		spin_lock(&ced->staged_lock);	/*  Lock others out */
 
-		if (ced_read_dma_info(&ced->dma_info, ced, pCh, dwCount)) {	/*  Get DMA parameters */
-			unsigned short wTransType = ced->dma_info.trans_type;	/*  check transfer type */
+		/* Get DMA parameters */
+		if (ced_read_dma_info(&ced->dma_info, ced, ch, count)) {
+			/* check transfer type */
+			unsigned short trans_type = ced->dma_info.trans_type;
 
 			dev_dbg(&ced->interface->dev,
 				"%s: xfer to %s, offset %d, length %d\n",
@@ -1154,22 +1157,22 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh,
 				dev_err(&ced->interface->dev,
 					"ERROR: DMA setup while transfer still waiting\n");
 			} else {
-				if ((wTransType == TM_EXTTOHOST)
-				    || (wTransType == TM_EXTTO1401)) {
-					iReturn =
+				if ((trans_type == TM_EXTTOHOST)
+				    || (trans_type == TM_EXTTO1401)) {
+					retval =
 					    ced_read_write_mem(ced,
 							 !ced->dma_info.outward,
 							 ced->dma_info.ident,
 							 ced->dma_info.offset,
 							 ced->dma_info.size);
-					if (iReturn != U14ERR_NOERROR)
+					if (retval != U14ERR_NOERROR)
 						dev_err(&ced->interface->dev,
 							"%s: ced_read_write_mem() failed %d\n",
-							__func__, iReturn);
-				} else	/*  This covers non-linear transfer setup */
+							__func__, retval);
+				} else	/* This covers non-linear transfer setup */
 					dev_err(&ced->interface->dev,
 						"%s: Unknown block xfer type %d\n",
-						__func__, wTransType);
+						__func__, trans_type);
 			}
 		} else		/*  Failed to read parameters */
 			dev_err(&ced->interface->dev, "%s: ced_read_dma_info() fail\n",
@@ -1178,9 +1181,9 @@ static int ced_handle_esc(struct ced_data *ced, char *pCh,
 		spin_unlock(&ced->staged_lock);	/*  OK here */
 	}
 
-	dev_dbg(&ced->interface->dev, "%s: returns %d\n", __func__, iReturn);
+	dev_dbg(&ced->interface->dev, "%s: returns %d\n", __func__, retval);
 
-	return iReturn;
+	return retval;
 }
 
 /****************************************************************************

The commit for this change in Linux stable tree is 13f9c56 (patch).

Last modified: 2020/02/10