From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, alan@linux.intel.com,
linux-kernel@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 6/7] mei: simplify write complete loop in irq handler
Date: Sun, 18 Nov 2012 15:13:19 +0200 [thread overview]
Message-ID: <1353244400-9619-6-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1353244400-9619-1-git-send-email-tomas.winkler@intel.com>
extract the common, hence non conditional code
from the if-else statment
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
drivers/misc/mei/interrupt.c | 37 ++++++++++++-------------------------
1 files changed, 12 insertions(+), 25 deletions(-)
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index cccb63a..e5aa0ed 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;
--
1.7.4.4
next prev parent reply other threads:[~2012-11-18 13:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-18 13:13 [char-misc-next 1/7] mei: compact code for mei bus message creation Tomas Winkler
2012-11-18 13:13 ` [char-misc-next 2/7] mei: use structured buffer for extra write buffer Tomas Winkler
2012-11-18 13:13 ` [char-misc-next 3/7] mei: streamline write complete flow function Tomas Winkler
2012-11-18 13:13 ` [char-misc-next 4/7] mei: streamline amthif write complete function Tomas Winkler
2012-11-18 13:13 ` [char-misc-next 5/7] mei: don't mix read and write slots Tomas Winkler
2012-11-18 13:13 ` Tomas Winkler [this message]
2012-11-18 13:13 ` [char-misc-next 7/7] mei: Simplify the ME client enumeration code Tomas Winkler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353244400-9619-6-git-send-email-tomas.winkler@intel.com \
--to=tomas.winkler@intel.com \
--cc=alan@linux.intel.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®