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

staging: ced1401: fix ced_get_transfer()

Rename camel case arguments and locals in function ced_get_transfer()
Signed-off-by: default avatarLuca Ellero <luca.ellero@brickedbrain.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4a376719
...@@ -939,17 +939,18 @@ int ced_test_event(struct ced_data *ced, int area) ...@@ -939,17 +939,18 @@ int ced_test_event(struct ced_data *ced, int area)
** ced_get_transferInfo ** ced_get_transferInfo
** Puts the current state of the 1401 in a TGET_TX_BLOCK. ** Puts the current state of the 1401 in a TGET_TX_BLOCK.
*****************************************************************************/ *****************************************************************************/
int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *pTX) int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *utx)
{ {
int iReturn = U14ERR_NOERROR; int ret = U14ERR_NOERROR;
unsigned int dwIdent; unsigned int dwIdent;
mutex_lock(&ced->io_mutex); mutex_lock(&ced->io_mutex);
dwIdent = ced->staged_id; /* area ident for last xfer */ dwIdent = ced->staged_id; /* area ident for last xfer */
if (dwIdent >= MAX_TRANSAREAS) if (dwIdent >= MAX_TRANSAREAS)
iReturn = U14ERR_BADAREA; ret = U14ERR_BADAREA;
else { else {
/* Return the best information we have - we don't have physical addresses */ /* Return the best information we have - we */
/* don't have physical addresses */
TGET_TX_BLOCK *tx; TGET_TX_BLOCK *tx;
tx = kzalloc(sizeof(*tx), GFP_KERNEL); tx = kzalloc(sizeof(*tx), GFP_KERNEL);
...@@ -959,18 +960,19 @@ int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *pTX) ...@@ -959,18 +960,19 @@ int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *pTX)
} }
tx->size = ced->trans_def[dwIdent].length; tx->size = ced->trans_def[dwIdent].length;
tx->linear = (long long)((long)ced->trans_def[dwIdent].buff); tx->linear = (long long)((long)ced->trans_def[dwIdent].buff);
tx->avail = GET_TX_MAXENTRIES; /* how many blocks we could return */ /* how many blocks we could return */
tx->avail = GET_TX_MAXENTRIES;
tx->used = 1; /* number we actually return */ tx->used = 1; /* number we actually return */
tx->entries[0].physical = tx->entries[0].physical =
(long long)(tx->linear + ced->staged_offset); (long long)(tx->linear + ced->staged_offset);
tx->entries[0].size = tx->size; tx->entries[0].size = tx->size;
if (copy_to_user(pTX, tx, sizeof(*tx))) if (copy_to_user(utx, tx, sizeof(*tx)))
iReturn = -EFAULT; ret = -EFAULT;
kfree(tx); kfree(tx);
} }
mutex_unlock(&ced->io_mutex); mutex_unlock(&ced->io_mutex);
return iReturn; return ret;
} }
/**************************************************************************** /****************************************************************************
......
...@@ -237,7 +237,7 @@ extern int ced_set_event(struct ced_data *ced, ...@@ -237,7 +237,7 @@ extern int ced_set_event(struct ced_data *ced,
extern int ced_stat_1401(struct ced_data *ced); extern int ced_stat_1401(struct ced_data *ced);
extern int ced_line_count(struct ced_data *ced); extern int ced_line_count(struct ced_data *ced);
extern int ced_get_out_buf_space(struct ced_data *ced); extern int ced_get_out_buf_space(struct ced_data *ced);
extern int ced_get_transfer(struct ced_data *ced, TGET_TX_BLOCK __user *pGTB); 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_kill_io(struct ced_data *ced);
extern int ced_state_of_1401(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_start_self_test(struct ced_data *ced);
......
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