Commit 7b7f6020 authored by Luca Ellero's avatar Luca Ellero Committed by Greg Kroah-Hartman

staging: ced1401: fix ced_get_circ_block()

Rename camel case arguments and locals in function ced_get_circ_block()
Signed-off-by: default avatarLuca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d9b57d9f
...@@ -1406,49 +1406,49 @@ int ced_set_circular(struct ced_data *ced, ...@@ -1406,49 +1406,49 @@ int ced_set_circular(struct ced_data *ced,
** **
** Return the next available block of circularly-transferred data. ** Return the next available block of circularly-transferred data.
****************************************************************************/ ****************************************************************************/
int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB) int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *ucb)
{ {
int iReturn = U14ERR_NOERROR; int ret = U14ERR_NOERROR;
unsigned int nArea; unsigned int area;
TCIRCBLOCK cb; TCIRCBLOCK cb;
dev_dbg(&ced->interface->dev, "%s\n", __func__); dev_dbg(&ced->interface->dev, "%s\n", __func__);
if (copy_from_user(&cb, pCB, sizeof(cb))) if (copy_from_user(&cb, ucb, sizeof(cb)))
return -EFAULT; return -EFAULT;
mutex_lock(&ced->io_mutex); mutex_lock(&ced->io_mutex);
nArea = cb.nArea; /* Retrieve parameters first */ area = cb.nArea; /* Retrieve parameters first */
cb.dwOffset = 0; /* set default result (nothing) */ cb.dwOffset = 0; /* set default result (nothing) */
cb.dwSize = 0; cb.dwSize = 0;
if (nArea < MAX_TRANSAREAS) { /* The area number must be OK */ if (area < MAX_TRANSAREAS) { /* The area number must be OK */
/* Pointer to relevant info */ /* Pointer to relevant info */
struct transarea *pArea = &ced->trans_def[nArea]; struct transarea *ta = &ced->trans_def[area];
spin_lock_irq(&ced->staged_lock); /* Lock others out */ spin_lock_irq(&ced->staged_lock); /* Lock others out */
if ((pArea->used) && (pArea->circular) && /* Must be circular area */ if ((ta->used) && (ta->circular) && /* Must be circular area */
(pArea->circ_to_host)) { /* For now at least must be to host */ (ta->circ_to_host)) { /* For now at least must be to host */
if (pArea->blocks[0].size > 0) { /* Got anything? */ if (ta->blocks[0].size > 0) { /* Got anything? */
cb.dwOffset = pArea->blocks[0].offset; cb.dwOffset = ta->blocks[0].offset;
cb.dwSize = pArea->blocks[0].size; cb.dwSize = ta->blocks[0].size;
dev_dbg(&ced->interface->dev, dev_dbg(&ced->interface->dev,
"%s: return block 0: %d bytes at %d\n", "%s: return block 0: %d bytes at %d\n",
__func__, cb.dwSize, cb.dwOffset); __func__, cb.dwSize, cb.dwOffset);
} }
} else } else
iReturn = U14ERR_NOTSET; ret = U14ERR_NOTSET;
spin_unlock_irq(&ced->staged_lock); spin_unlock_irq(&ced->staged_lock);
} else } else
iReturn = U14ERR_BADAREA; ret = U14ERR_BADAREA;
if (copy_to_user(pCB, &cb, sizeof(cb))) if (copy_to_user(ucb, &cb, sizeof(cb)))
iReturn = -EFAULT; ret = -EFAULT;
mutex_unlock(&ced->io_mutex); mutex_unlock(&ced->io_mutex);
return iReturn; return ret;
} }
/**************************************************************************** /****************************************************************************
......
...@@ -253,7 +253,7 @@ extern int ced_dbg_get_data(struct ced_data *ced, TDBGBLOCK __user *udb); ...@@ -253,7 +253,7 @@ extern int ced_dbg_get_data(struct ced_data *ced, TDBGBLOCK __user *udb);
extern int ced_dbg_stop_loop(struct ced_data *ced); extern int ced_dbg_stop_loop(struct ced_data *ced);
extern int ced_set_circular(struct ced_data *ced, extern int ced_set_circular(struct ced_data *ced,
struct transfer_area_desc __user *utd); struct transfer_area_desc __user *utd);
extern int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB); extern int ced_get_circ_block(struct ced_data *ced, TCIRCBLOCK __user *ucb);
extern int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB); extern int ced_free_circ_block(struct ced_data *ced, TCIRCBLOCK __user *pCB);
extern int ced_wait_event(struct ced_data *ced, int area, int time_out); extern int ced_wait_event(struct ced_data *ced, int area, int time_out);
extern int ced_test_event(struct ced_data *ced, int area); extern int ced_test_event(struct ced_data *ced, int area);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment