|
@@ -259,7 +259,7 @@ struct mei_cl_cb *find_amthi_read_list_entry(
|
|
|
* negative on failure.
|
|
|
*/
|
|
|
int amthi_read(struct mei_device *dev, struct file *file,
|
|
|
- char __user *ubuf, size_t length, loff_t *offset)
|
|
|
+ char __user *ubuf, size_t length, loff_t *offset)
|
|
|
{
|
|
|
int rets;
|
|
|
int wait_ret;
|
|
@@ -331,8 +331,7 @@ int amthi_read(struct mei_device *dev, struct file *file,
|
|
|
}
|
|
|
}
|
|
|
/* if the whole message will fit remove it from the list */
|
|
|
- if (cb->information >= *offset &&
|
|
|
- length >= (cb->information - *offset))
|
|
|
+ if (cb->information >= *offset && length >= (cb->information - *offset))
|
|
|
list_del(&cb->cb_list);
|
|
|
else if (cb->information > 0 && cb->information <= *offset) {
|
|
|
/* end of the message has been reached */
|
|
@@ -353,9 +352,7 @@ int amthi_read(struct mei_device *dev, struct file *file,
|
|
|
* the information may be longer */
|
|
|
length = min_t(size_t, length, (cb->information - *offset));
|
|
|
|
|
|
- if (copy_to_user(ubuf,
|
|
|
- cb->response_buffer.data + *offset,
|
|
|
- length))
|
|
|
+ if (copy_to_user(ubuf, cb->response_buffer.data + *offset, length))
|
|
|
rets = -EFAULT;
|
|
|
else {
|
|
|
rets = length;
|
|
@@ -424,7 +421,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
|
|
|
|
|
|
cb->response_buffer.size = dev->me_clients[i].props.max_msg_length;
|
|
|
cb->response_buffer.data =
|
|
|
- kmalloc(cb->response_buffer.size, GFP_KERNEL);
|
|
|
+ kmalloc(cb->response_buffer.size, GFP_KERNEL);
|
|
|
if (!cb->response_buffer.data) {
|
|
|
rets = -ENOMEM;
|
|
|
goto unlock;
|
|
@@ -445,8 +442,7 @@ int mei_start_read(struct mei_device *dev, struct mei_cl *cl)
|
|
|
&dev->read_list.mei_cb.cb_list);
|
|
|
}
|
|
|
} else {
|
|
|
- list_add_tail(&cb->cb_list,
|
|
|
- &dev->ctrl_wr_list.mei_cb.cb_list);
|
|
|
+ list_add_tail(&cb->cb_list, &dev->ctrl_wr_list.mei_cb.cb_list);
|
|
|
}
|
|
|
return rets;
|
|
|
unlock:
|
|
@@ -479,7 +475,7 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb)
|
|
|
dev->iamthif_ioctl = true;
|
|
|
dev->iamthif_msg_buf_size = cb->request_buffer.size;
|
|
|
memcpy(dev->iamthif_msg_buf, cb->request_buffer.data,
|
|
|
- cb->request_buffer.size);
|
|
|
+ cb->request_buffer.size);
|
|
|
|
|
|
ret = mei_flow_ctrl_creds(dev, &dev->iamthif_cl);
|
|
|
if (ret < 0)
|
|
@@ -531,8 +527,7 @@ int amthi_write(struct mei_device *dev, struct mei_cl_cb *cb)
|
|
|
|
|
|
dev_dbg(&dev->pdev->dev, "No flow control credentials, "
|
|
|
"so add iamthif cb to write list.\n");
|
|
|
- list_add_tail(&cb->cb_list,
|
|
|
- &dev->write_list.mei_cb.cb_list);
|
|
|
+ list_add_tail(&cb->cb_list, &dev->write_list.mei_cb.cb_list);
|
|
|
}
|
|
|
return 0;
|
|
|
}
|