diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-12-25 12:05:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-07 13:31:27 -0500 |
commit | 438763f37eb9664b6372bdfee990f8c33acdc63c (patch) | |
tree | 71f2feab0d7b91cfd28c538c2943a8d8fe000c96 /drivers/misc/mei/interrupt.c | |
parent | d1c3ed669a2d452cacfb48c2d171a1f364dae2ed (diff) |
mei: drop redundant length parameter from mei_write_message function
The length is already part of the message header and it is validated
before the function call
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r-- | drivers/misc/mei/interrupt.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 04fa2134615e..b72fa8196ddb 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -465,7 +465,7 @@ static void mei_client_disconnect_request(struct mei_device *dev, | |||
465 | * @mei_hdr: header of bus message | 465 | * @mei_hdr: header of bus message |
466 | */ | 466 | */ |
467 | static void mei_irq_thread_read_bus_message(struct mei_device *dev, | 467 | static void mei_irq_thread_read_bus_message(struct mei_device *dev, |
468 | struct mei_msg_hdr *mei_hdr) | 468 | struct mei_msg_hdr *hdr) |
469 | { | 469 | { |
470 | struct mei_bus_message *mei_msg; | 470 | struct mei_bus_message *mei_msg; |
471 | struct mei_me_client *me_client; | 471 | struct mei_me_client *me_client; |
@@ -479,8 +479,8 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, | |||
479 | struct hbm_host_stop_request *stop_req; | 479 | struct hbm_host_stop_request *stop_req; |
480 | 480 | ||
481 | /* read the message to our buffer */ | 481 | /* read the message to our buffer */ |
482 | BUG_ON(mei_hdr->length >= sizeof(dev->rd_msg_buf)); | 482 | BUG_ON(hdr->length >= sizeof(dev->rd_msg_buf)); |
483 | mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length); | 483 | mei_read_slots(dev, dev->rd_msg_buf, hdr->length); |
484 | mei_msg = (struct mei_bus_message *)dev->rd_msg_buf; | 484 | mei_msg = (struct mei_bus_message *)dev->rd_msg_buf; |
485 | 485 | ||
486 | switch (mei_msg->hbm_cmd) { | 486 | switch (mei_msg->hbm_cmd) { |
@@ -506,14 +506,13 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, | |||
506 | dev->version = version_res->me_max_version; | 506 | dev->version = version_res->me_max_version; |
507 | 507 | ||
508 | /* send stop message */ | 508 | /* send stop message */ |
509 | mei_hdr = mei_hbm_hdr(&buf[0], len); | 509 | hdr = mei_hbm_hdr(&buf[0], len); |
510 | stop_req = (struct hbm_host_stop_request *)&buf[1]; | 510 | stop_req = (struct hbm_host_stop_request *)&buf[1]; |
511 | memset(stop_req, 0, len); | 511 | memset(stop_req, 0, len); |
512 | stop_req->hbm_cmd = HOST_STOP_REQ_CMD; | 512 | stop_req->hbm_cmd = HOST_STOP_REQ_CMD; |
513 | stop_req->reason = DRIVER_STOP_REQUEST; | 513 | stop_req->reason = DRIVER_STOP_REQUEST; |
514 | 514 | ||
515 | mei_write_message(dev, mei_hdr, | 515 | mei_write_message(dev, hdr, (unsigned char *)stop_req); |
516 | (unsigned char *)stop_req, len); | ||
517 | dev_dbg(&dev->pdev->dev, "version mismatch.\n"); | 516 | dev_dbg(&dev->pdev->dev, "version mismatch.\n"); |
518 | return; | 517 | return; |
519 | } | 518 | } |
@@ -615,7 +614,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev, | |||
615 | 614 | ||
616 | const size_t len = sizeof(struct hbm_host_stop_request); | 615 | const size_t len = sizeof(struct hbm_host_stop_request); |
617 | 616 | ||
618 | mei_hdr = mei_hbm_hdr((u32 *)&dev->wr_ext_msg.hdr, len); | 617 | hdr = mei_hbm_hdr((u32 *)&dev->wr_ext_msg.hdr, len); |
619 | stop_req = (struct hbm_host_stop_request *)&dev->wr_ext_msg.data; | 618 | stop_req = (struct hbm_host_stop_request *)&dev->wr_ext_msg.data; |
620 | memset(stop_req, 0, len); | 619 | memset(stop_req, 0, len); |
621 | stop_req->hbm_cmd = HOST_STOP_REQ_CMD; | 620 | stop_req->hbm_cmd = HOST_STOP_REQ_CMD; |
@@ -748,7 +747,7 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots, | |||
748 | 747 | ||
749 | *slots -= msg_slots; | 748 | *slots -= msg_slots; |
750 | if (mei_write_message(dev, mei_hdr, | 749 | if (mei_write_message(dev, mei_hdr, |
751 | cb->request_buffer.data + cb->buf_idx, len)) { | 750 | cb->request_buffer.data + cb->buf_idx)) { |
752 | cl->status = -ENODEV; | 751 | cl->status = -ENODEV; |
753 | list_move_tail(&cb->list, &cmpl_list->list); | 752 | list_move_tail(&cb->list, &cmpl_list->list); |
754 | return -ENODEV; | 753 | return -ENODEV; |
@@ -930,7 +929,7 @@ static int mei_irq_thread_write_handler(struct mei_device *dev, | |||
930 | 929 | ||
931 | if (dev->wr_ext_msg.hdr.length) { | 930 | if (dev->wr_ext_msg.hdr.length) { |
932 | mei_write_message(dev, &dev->wr_ext_msg.hdr, | 931 | mei_write_message(dev, &dev->wr_ext_msg.hdr, |
933 | dev->wr_ext_msg.data, dev->wr_ext_msg.hdr.length); | 932 | dev->wr_ext_msg.data); |
934 | slots -= mei_data2slots(dev->wr_ext_msg.hdr.length); | 933 | slots -= mei_data2slots(dev->wr_ext_msg.hdr.length); |
935 | dev->wr_ext_msg.hdr.length = 0; | 934 | dev->wr_ext_msg.hdr.length = 0; |
936 | } | 935 | } |