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>
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 @@
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;