aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/wd.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-12-25 19:06:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-07 10:31:29 -0800
commite46f187487a8c28e64417e51ba628746a5397838 (patch)
tree484cc0102c738d7aae646822baabd71ad715eaf9 /drivers/misc/mei/wd.c
parentmei: simplify preparing client host bus messages (diff)
downloadlinux-dev-e46f187487a8c28e64417e51ba628746a5397838.tar.xz
linux-dev-e46f187487a8c28e64417e51ba628746a5397838.zip
mei: use structured buffer for the write buffer
We can drop useless castings and use proper types. We remove the casting in mei_hbm_hdr function and add new function mei_hbm_stop_request_prepare that utilize the new structure Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/wd.c')
-rw-r--r--drivers/misc/mei/wd.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c
index 9c3738a4eb08..3997a630847f 100644
--- a/drivers/misc/mei/wd.c
+++ b/drivers/misc/mei/wd.c
@@ -101,22 +101,21 @@ int mei_wd_host_init(struct mei_device *dev)
*/
int mei_wd_send(struct mei_device *dev)
{
- struct mei_msg_hdr *hdr;
+ struct mei_msg_hdr hdr;
- hdr = (struct mei_msg_hdr *) &dev->wr_msg_buf[0];
- hdr->host_addr = dev->wd_cl.host_client_id;
- hdr->me_addr = dev->wd_cl.me_client_id;
- hdr->msg_complete = 1;
- hdr->reserved = 0;
+ hdr.host_addr = dev->wd_cl.host_client_id;
+ hdr.me_addr = dev->wd_cl.me_client_id;
+ hdr.msg_complete = 1;
+ hdr.reserved = 0;
if (!memcmp(dev->wd_data, mei_start_wd_params, MEI_WD_HDR_SIZE))
- hdr->length = MEI_WD_START_MSG_SIZE;
+ hdr.length = MEI_WD_START_MSG_SIZE;
else if (!memcmp(dev->wd_data, mei_stop_wd_params, MEI_WD_HDR_SIZE))
- hdr->length = MEI_WD_STOP_MSG_SIZE;
+ hdr.length = MEI_WD_STOP_MSG_SIZE;
else
return -EINVAL;
- return mei_write_message(dev, hdr, dev->wd_data);
+ return mei_write_message(dev, &hdr, dev->wd_data);
}
/**