|
@@ -1373,29 +1373,32 @@ int ced_dbg_stop_loop(struct ced_data *ced)
|
|
** booked and a transfer to that area is in progress. Otherwise, we will
|
|
** booked and a transfer to that area is in progress. Otherwise, we will
|
|
** release the area and re-assign it.
|
|
** release the area and re-assign it.
|
|
****************************************************************************/
|
|
****************************************************************************/
|
|
-int ced_set_circular(struct ced_data *ced, struct transfer_area_desc __user *pTD)
|
|
|
|
|
|
+int ced_set_circular(struct ced_data *ced,
|
|
|
|
+ struct transfer_area_desc __user *utd)
|
|
{
|
|
{
|
|
- int iReturn;
|
|
|
|
- bool bToHost;
|
|
|
|
|
|
+ int ret;
|
|
|
|
+ bool to_host;
|
|
struct transfer_area_desc td;
|
|
struct transfer_area_desc td;
|
|
|
|
|
|
- if (copy_from_user(&td, pTD, sizeof(td)))
|
|
|
|
|
|
+ if (copy_from_user(&td, utd, sizeof(td)))
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
|
|
|
|
mutex_lock(&ced->io_mutex);
|
|
mutex_lock(&ced->io_mutex);
|
|
dev_dbg(&ced->interface->dev, "%s: area:%d, size:%08x\n",
|
|
dev_dbg(&ced->interface->dev, "%s: area:%d, size:%08x\n",
|
|
__func__, td.wAreaNum, td.dwLength);
|
|
__func__, td.wAreaNum, td.dwLength);
|
|
- bToHost = td.eSize != 0; /* this is used as the tohost flag */
|
|
|
|
|
|
+ to_host = td.eSize != 0; /* this is used as the tohost flag */
|
|
|
|
|
|
- /* The strange cast is done so that we don't get warnings in 32-bit linux about the size of the */
|
|
|
|
- /* pointer. The pointer is always passed as a 64-bit object so that we don't have problems using */
|
|
|
|
- /* a 32-bit program on a 64-bit system. unsigned long is 64-bits on a 64-bit system. */
|
|
|
|
- iReturn =
|
|
|
|
|
|
+ /* The strange cast is done so that we don't get warnings in 32-bit */
|
|
|
|
+ /* linux about the size of the pointer. The pointer is always passed */
|
|
|
|
+ /* as a 64-bit object so that we don't have problems using a 32-bit */
|
|
|
|
+ /* program on a 64-bit system. unsigned long is 64-bits on a 64-bit */
|
|
|
|
+ /* system. */
|
|
|
|
+ ret =
|
|
ced_set_area(ced, td.wAreaNum,
|
|
ced_set_area(ced, td.wAreaNum,
|
|
(char __user *)((unsigned long)td.lpvBuff), td.dwLength,
|
|
(char __user *)((unsigned long)td.lpvBuff), td.dwLength,
|
|
- true, bToHost);
|
|
|
|
|
|
+ true, to_host);
|
|
mutex_unlock(&ced->io_mutex);
|
|
mutex_unlock(&ced->io_mutex);
|
|
- return iReturn;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
/****************************************************************************
|
|
/****************************************************************************
|