aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interface.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-07-04 12:24:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-10 17:58:35 -0400
commit7bdf72d3d8059a50214069ea4b87c2174645f40f (patch)
treeb54edc0497ab402791422a50905e59fc49f71f51 /drivers/misc/mei/interface.h
parent7cb1ba9b679afe5fc335205fd6fb25fd3e51e33a (diff)
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.h')
-rw-r--r--drivers/misc/mei/interface.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/mei/interface.h b/drivers/misc/mei/interface.h
index cd9b778e8dc5..fb5c7db4723b 100644
--- a/drivers/misc/mei/interface.h
+++ b/drivers/misc/mei/interface.h
@@ -50,6 +50,12 @@ static inline size_t mei_hbuf_max_data(const struct mei_device *dev)
50 return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr); 50 return dev->hbuf_depth * sizeof(u32) - sizeof(struct mei_msg_hdr);
51} 51}
52 52
53/* get slots (dwords) from a message length + header (bytes) */
54static inline unsigned char mei_data2slots(size_t length)
55{
56 return DIV_ROUND_UP(sizeof(struct mei_msg_hdr) + length, 4);
57}
58
53int mei_count_full_read_slots(struct mei_device *dev); 59int mei_count_full_read_slots(struct mei_device *dev);
54 60
55 61