If statement conditional is comprised of a logical continuation that contains the same truth value check multiple times. This conditional can be more succinctly expressed by splitting the conditional into two separate statements, this makes the code easier to read. Move truth values out of complex logical continuation to a separate check. Do not change program logic. Signed-off-by: Tobin C. Harding <me@xxxxxxxx> --- drivers/staging/ks7010/ks_hostif.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index e17ce22..e246574 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -333,13 +333,13 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv, priv->nstats.rx_errors++; return -EINVAL; } - if (((auth_type == TYPE_PMK1 && - priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) || - (auth_type == TYPE_GMK1 && - priv->wpa.group_suite == IW_AUTH_CIPHER_TKIP) || - (auth_type == TYPE_GMK2 && - priv->wpa.group_suite == IW_AUTH_CIPHER_TKIP)) && - key->key_len) { + + if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP && key->key_len); + return 0; + + if (auth_type == TYPE_PMK1 || + auth_type == TYPE_GMK1 || + auth_type == TYPE_GMK2) { DPRINTK(4, "TKIP: protocol=%04X: size=%u\n", eth_proto, priv->rx_size); /* MIC save */ -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel