aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/amthif.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-11-11 10:37:59 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 18:34:18 -0500
commitdb3ed43185c6f5d4fd6c5ac963347b849540996e (patch)
tree46690fbfd58c7d2da479865c7061f6c50b8d6d64 /drivers/misc/mei/amthif.c
parente773efc405026bb8540c84bf45420bd66d5b34a7 (diff)
mei: use type struct mei_cl *cl instead of void in struct mei_cb
We can use correct type 'struct mei_cl' instead of 'void *' for file_private in the struct mei_cb as there is no other type assigned to this member of the structure We rename the member from file_private to cl Remove about 10 lines of declarations of temporary variables used for type casting Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/amthif.c')
-rw-r--r--drivers/misc/mei/amthif.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 1de28df94da4..74d593fd6cbd 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -119,14 +119,12 @@ void mei_amthif_host_init(struct mei_device *dev)
119struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev, 119struct mei_cl_cb *mei_amthif_find_read_list_entry(struct mei_device *dev,
120 struct file *file) 120 struct file *file)
121{ 121{
122 struct mei_cl *cl_temp;
123 struct mei_cl_cb *pos = NULL; 122 struct mei_cl_cb *pos = NULL;
124 struct mei_cl_cb *next = NULL; 123 struct mei_cl_cb *next = NULL;
125 124
126 list_for_each_entry_safe(pos, next, 125 list_for_each_entry_safe(pos, next,
127 &dev->amthif_rd_complete_list.list, list) { 126 &dev->amthif_rd_complete_list.list, list) {
128 cl_temp = (struct mei_cl *)pos->file_private; 127 if (pos->cl && pos->cl == &dev->iamthif_cl &&
129 if (cl_temp && cl_temp == &dev->iamthif_cl &&
130 pos->file_object == file) 128 pos->file_object == file)
131 return pos; 129 return pos;
132 } 130 }
@@ -370,7 +368,6 @@ int mei_amthif_write(struct mei_device *dev, struct mei_cl_cb *cb)
370 */ 368 */
371void mei_amthif_run_next_cmd(struct mei_device *dev) 369void mei_amthif_run_next_cmd(struct mei_device *dev)
372{ 370{
373 struct mei_cl *cl_tmp;
374 struct mei_cl_cb *pos = NULL; 371 struct mei_cl_cb *pos = NULL;
375 struct mei_cl_cb *next = NULL; 372 struct mei_cl_cb *next = NULL;
376 int status; 373 int status;
@@ -390,9 +387,8 @@ void mei_amthif_run_next_cmd(struct mei_device *dev)
390 387
391 list_for_each_entry_safe(pos, next, &dev->amthif_cmd_list.list, list) { 388 list_for_each_entry_safe(pos, next, &dev->amthif_cmd_list.list, list) {
392 list_del(&pos->list); 389 list_del(&pos->list);
393 cl_tmp = (struct mei_cl *)pos->file_private;
394 390
395 if (cl_tmp && cl_tmp == &dev->iamthif_cl) { 391 if (pos->cl && pos->cl == &dev->iamthif_cl) {
396 status = mei_amthif_send_cmd(dev, pos); 392 status = mei_amthif_send_cmd(dev, pos);
397 if (status) { 393 if (status) {
398 dev_dbg(&dev->pdev->dev, 394 dev_dbg(&dev->pdev->dev,
@@ -500,7 +496,6 @@ int mei_amthif_irq_process_completed(struct mei_device *dev, s32 *slots,
500int mei_amthif_irq_read_message(struct mei_cl_cb *complete_list, 496int mei_amthif_irq_read_message(struct mei_cl_cb *complete_list,
501 struct mei_device *dev, struct mei_msg_hdr *mei_hdr) 497 struct mei_device *dev, struct mei_msg_hdr *mei_hdr)
502{ 498{
503 struct mei_cl *cl;
504 struct mei_cl_cb *cb; 499 struct mei_cl_cb *cb;
505 unsigned char *buffer; 500 unsigned char *buffer;
506 501
@@ -528,14 +523,13 @@ int mei_amthif_irq_read_message(struct mei_cl_cb *complete_list,
528 cb = dev->iamthif_current_cb; 523 cb = dev->iamthif_current_cb;
529 dev->iamthif_current_cb = NULL; 524 dev->iamthif_current_cb = NULL;
530 525
531 cl = (struct mei_cl *)cb->file_private; 526 if (!cb->cl)
532 if (!cl)
533 return -ENODEV; 527 return -ENODEV;
534 528
535 dev->iamthif_stall_timer = 0; 529 dev->iamthif_stall_timer = 0;
536 cb->buf_idx = dev->iamthif_msg_buf_index; 530 cb->buf_idx = dev->iamthif_msg_buf_index;
537 cb->read_time = jiffies; 531 cb->read_time = jiffies;
538 if (dev->iamthif_ioctl && cl == &dev->iamthif_cl) { 532 if (dev->iamthif_ioctl && cb->cl == &dev->iamthif_cl) {
539 /* found the iamthif cb */ 533 /* found the iamthif cb */
540 dev_dbg(&dev->pdev->dev, "complete the amthi read cb.\n "); 534 dev_dbg(&dev->pdev->dev, "complete the amthi read cb.\n ");
541 dev_dbg(&dev->pdev->dev, "add the amthi read cb to complete.\n "); 535 dev_dbg(&dev->pdev->dev, "add the amthi read cb to complete.\n ");