aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/hw-me.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-03-11 12:27:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-15 14:10:48 -0400
commitc8c8d080ed94cea6757f2d781b6e360a74b256fd (patch)
tree5fa9937912d66e7d6633c3109fdce1b344c8728f /drivers/misc/mei/hw-me.c
parent388f7bd24d2ffc945ad08be3a592672c1e32156e (diff)
mei: revamp mei_data2slots
1. Move the mei_data2slots to mei_dev.h as it will be used by the all supported HW. 2. Change return value from u8 to u32 to catch possible overflows 3. Eliminate computing the slots number twice in the same function Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hw-me.c')
-rw-r--r--drivers/misc/mei/hw-me.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c
index 45ea7185c003..d21e5a761f2c 100644
--- a/drivers/misc/mei/hw-me.c
+++ b/drivers/misc/mei/hw-me.c
@@ -295,10 +295,11 @@ static int mei_me_write_message(struct mei_device *dev,
295 unsigned char *buf) 295 unsigned char *buf)
296{ 296{
297 struct mei_me_hw *hw = to_me_hw(dev); 297 struct mei_me_hw *hw = to_me_hw(dev);
298 unsigned long rem, dw_cnt; 298 unsigned long rem;
299 unsigned long length = header->length; 299 unsigned long length = header->length;
300 u32 *reg_buf = (u32 *)buf; 300 u32 *reg_buf = (u32 *)buf;
301 u32 hcsr; 301 u32 hcsr;
302 u32 dw_cnt;
302 int i; 303 int i;
303 int empty_slots; 304 int empty_slots;
304 305