summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2012-11-18 17:13:19 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-22 00:43:58 +0400
commitbe9d87a790765bcc85d8bdab8a9be31cf7457b28 (patch)
tree61d378f2d19f9536b03405b4fafacd61cfe10ab1 /drivers/misc
parent9a84d616980215d1d9222173c60329b57680483b (diff)
downloadlinux-be9d87a790765bcc85d8bdab8a9be31cf7457b28.tar.xz
mei: simplify write complete loop in irq handler
extract the common, hence non conditional code from the if-else statment Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/interrupt.c37
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index cccb63a8c007..e5aa0ed3b8eb 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -1027,34 +1027,21 @@ static int mei_irq_thread_write_handler(struct mei_device *dev,
cl = pos->cl;
if (cl == NULL)
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 (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;
- }
+ if (cl == &dev->iamthif_cl)
ret = mei_amthif_irq_write_complete(dev, &slots,
pos, cmpl_list);
- if (ret)
- return ret;
-
- }
+ else
+ ret = mei_irq_thread_write_complete(dev, &slots, pos,
+ cmpl_list);
+ if (ret)
+ return ret;
}
return 0;