summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-03-22 13:06:27 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-23 14:27:23 +0100
commit2c4951adfae24d901c699ebb918bb6e5c7865ab7 (patch)
treeee0ab4b8fe0b9d27537f25e4b9fdcb4349a72f9e
parent6ad6e21bd4e4edd1a3f59dc74b5f238455c05e71 (diff)
staging: ks7010: invert if statement conditionals
Checkpatch emits WARNING: Avoid multiple line dereference. Function uses if statement blocks to guard the body of the function. If we invert these conditionals and return, then the code becomes more readable and subsequent code is indented less. The checkpatch fix then follows trivially. Invert conditionals, return from function if new conditional evaluates to true. Reduce the level of indentation in subsequent code. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/ks7010/ks_hostif.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index d329735fda1d..e17ce229f1a8 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -2607,16 +2607,16 @@ void hostif_sme_task(unsigned long dev)
DPRINTK(3, "\n");
- if (priv->dev_state >= DEVICE_STATE_BOOT) {
- if (cnt_smeqbody(priv) > 0) {
- hostif_sme_execute(priv,
- priv->sme_i.event_buff[priv->sme_i.
- qhead]);
- inc_smeqhead(priv);
- if (cnt_smeqbody(priv) > 0)
- tasklet_schedule(&priv->sme_task);
- }
- }
+ if (priv->dev_state < DEVICE_STATE_BOOT)
+ return;
+
+ if (cnt_smeqbody(priv) <= 0)
+ return;
+
+ hostif_sme_execute(priv, priv->sme_i.event_buff[priv->sme_i.qhead]);
+ inc_smeqhead(priv);
+ if (cnt_smeqbody(priv) > 0)
+ tasklet_schedule(&priv->sme_task);
}
/* send to Station Management Entity module */