lkml.org 
[lkml]   [2012]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] mei: reduce indentation in read_bus_message
Date
From: "Devin J. Pohly" <djpohly@gmail.com>

A chunk of code can be deindented by checking conditions early.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
---
drivers/staging/mei/interrupt.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/mei/interrupt.c b/drivers/staging/mei/interrupt.c
index f2c864e..c2800ba 100644
--- a/drivers/staging/mei/interrupt.c
+++ b/drivers/staging/mei/interrupt.c
@@ -621,21 +621,7 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
switch (*(u8 *) mei_msg) {
case HOST_START_RES_CMD:
version_res = (struct hbm_host_version_response *) mei_msg;
- if (version_res->host_version_supported) {
- dev->version.major_version = HBM_MAJOR_VERSION;
- dev->version.minor_version = HBM_MINOR_VERSION;
- if (dev->mei_state == MEI_INIT_CLIENTS &&
- dev->init_clients_state ==
- MEI_START_MESSAGE) {
- dev->init_clients_timer = 0;
- mei_host_enum_clients_message(dev);
- } else {
- dev->recvd_msg = false;
- dev_dbg(&dev->pdev->dev, "IMEI reset due to received host start response bus message.\n");
- mei_reset(dev, 1);
- return;
- }
- } else {
+ if (!version_res->host_version_supported) {
dev->version = version_res->me_max_version;
/* send stop message */
mei_hdr->host_addr = 0;
@@ -657,6 +643,19 @@ static void mei_irq_thread_read_bus_message(struct mei_device *dev,
return;
}

+ dev->version.major_version = HBM_MAJOR_VERSION;
+ dev->version.minor_version = HBM_MINOR_VERSION;
+ if (dev->mei_state != MEI_INIT_CLIENTS ||
+ dev->init_clients_state !=
+ MEI_START_MESSAGE) {
+ dev->recvd_msg = false;
+ dev_dbg(&dev->pdev->dev, "IMEI reset due to received host start response bus message.\n");
+ mei_reset(dev, 1);
+ return;
+ }
+ dev->init_clients_timer = 0;
+ mei_host_enum_clients_message(dev);
+
dev->recvd_msg = true;
dev_dbg(&dev->pdev->dev, "host start response message received.\n");
break;
--
1.7.9.2


\
 
 \ /
  Last update: 2012-02-24 02:41    [W:0.052 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site