diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2012-07-04 19:24:52 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-10 14:58:35 -0700 |
commit | 7bdf72d3d8059a50214069ea4b87c2174645f40f (patch) | |
tree | b54edc0497ab402791422a50905e59fc49f71f51 /drivers/misc/mei/interface.c | |
parent | 7cb1ba9b679afe5fc335205fd6fb25fd3e51e33a (diff) | |
download | op-kernel-dev-7bdf72d3d8059a50214069ea4b87c2174645f40f.zip op-kernel-dev-7bdf72d3d8059a50214069ea4b87c2174645f40f.tar.gz |
mei: introduce mei_data2slots wrapper
Introduce mei_data2slots wrapper for sake of
readability. This wrapper close up the open code
for computing slots from a message length:
rond up dwords count from payload and header byte size
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interface.c')
-rw-r--r-- | drivers/misc/mei/interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mei/interface.c b/drivers/misc/mei/interface.c index 88ada64..509c395 100644 --- a/drivers/misc/mei/interface.c +++ b/drivers/misc/mei/interface.c @@ -135,7 +135,7 @@ int mei_write_message(struct mei_device *dev, struct mei_msg_hdr *header, empty_slots = mei_hbuf_empty_slots(dev); dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots); - dw_cnt = (length + sizeof(*header) + 3) / 4; + dw_cnt = mei_data2slots(length); if (empty_slots < 0 || dw_cnt > empty_slots) return -EIO; |