Commit be9d87a7 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: simplify write complete loop in irq handler

extract the common, hence non conditional code
from the if-else statment
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9a84d616
...@@ -1027,34 +1027,21 @@ static int mei_irq_thread_write_handler(struct mei_device *dev, ...@@ -1027,34 +1027,21 @@ static int mei_irq_thread_write_handler(struct mei_device *dev,
cl = pos->cl; cl = pos->cl;
if (cl == NULL) if (cl == NULL)
continue; continue;
if (mei_flow_ctrl_creds(dev, cl) <= 0) {
dev_dbg(&dev->pdev->dev,
"No flow control credentials for client %d, not sending.\n",
cl->host_client_id);
continue;
}
if (cl != &dev->iamthif_cl) { if (cl == &dev->iamthif_cl)
if (mei_flow_ctrl_creds(dev, cl) <= 0) {
dev_dbg(&dev->pdev->dev,
"No flow control credentials for client %d, not sending.\n",
cl->host_client_id);
continue;
}
ret = mei_irq_thread_write_complete(dev, &slots, pos,
cmpl_list);
if (ret)
return ret;
} else if (cl == &dev->iamthif_cl) {
/* IAMTHIF IOCTL */
dev_dbg(&dev->pdev->dev, "complete amthi write cb.\n");
if (mei_flow_ctrl_creds(dev, cl) <= 0) {
dev_dbg(&dev->pdev->dev,
"No flow control credentials for amthi client %d.\n",
cl->host_client_id);
continue;
}
ret = mei_amthif_irq_write_complete(dev, &slots, ret = mei_amthif_irq_write_complete(dev, &slots,
pos, cmpl_list); pos, cmpl_list);
if (ret) else
return ret; ret = mei_irq_thread_write_complete(dev, &slots, pos,
cmpl_list);
} if (ret)
return ret;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment