]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: ks7010: refactor newly separated function
authorTobin C. Harding <me@tobin.cc>
Mon, 13 Mar 2017 06:38:19 +0000 (17:38 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Mar 2017 22:20:06 +0000 (06:20 +0800)
Checkpatch emits various warnings and checks;

WARNING: Avoid multiple line dereference
CHECK: Alignment should match open parenthesis
WARNING: line over 80 characters
CHECK: Blank lines aren't necessary before a close brace '}'

These are all whitespace fixes.

Refactor whitespace inline with kernel coding style. Fix various
checkpatch warnings.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c

index 461482b6e47966e08fc9aa475b64c4683aabea35..5bb9f3526f60882bab978ceeb51b7931fc788b42 100644 (file)
@@ -342,21 +342,22 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
                DPRINTK(4, "TKIP: protocol=%04X: size=%u\n",
                        eth_proto, priv->rx_size);
                /* MIC save */
-               memcpy(&RecvMIC[0],
-                       (priv->rxp) + ((priv->rx_size) - 8), 8);
+               memcpy(&RecvMIC[0], (priv->rxp) + ((priv->rx_size) - 8), 8);
                priv->rx_size = priv->rx_size - 8;
                if (auth_type > 0 && auth_type < 4) {   /* auth_type check */
-                       MichaelMICFunction(&michel_mic, (uint8_t *)priv->wpa.key[auth_type - 1].rx_mic_key, (uint8_t *)priv->rxp, (int)priv->rx_size, (uint8_t)0,       /* priority */
-                                       (uint8_t *)michel_mic.Result);
+                       MichaelMICFunction(&michel_mic,
+                                          (uint8_t *)priv->wpa.key[auth_type - 1].rx_mic_key,
+                                          (uint8_t *)priv->rxp,
+                                          (int)priv->rx_size,
+                                          (uint8_t)0,  /* priority */
+                                          (uint8_t *)michel_mic.Result);
                }
                if (memcmp(michel_mic.Result, RecvMIC, 8)) {
                        now = jiffies;
                        mic_failure = &priv->wpa.mic_failure;
                        /* MIC FAILURE */
                        if (mic_failure->last_failure_time &&
-                               (now -
-                                       mic_failure->last_failure_time) /
-                               HZ >= 60) {
+                           (now - mic_failure->last_failure_time) / HZ >= 60) {
                                mic_failure->failure = 0;
                        }
                        DPRINTK(4, "MIC FAILURE\n");
@@ -366,39 +367,30 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
                        } else if (mic_failure->failure == 1) {
                                mic_failure->failure = 2;
                                mic_failure->counter =
-                                       (uint16_t)((now -
-                                                       mic_failure->
-                                                       last_failure_time)
-                                               / HZ);
+                                       (uint16_t)((now - mic_failure->last_failure_time) / HZ);
                                if (!mic_failure->counter)      /* mic_failure counter value range 1-60 */
-                                       mic_failure->counter =
-                                               1;
+                                       mic_failure->counter = 1;
                        }
-                       priv->wpa.mic_failure.
-                               last_failure_time = now;
+                       priv->wpa.mic_failure.last_failure_time = now;
+
                        /*  needed parameters: count, keyid, key type, TSC */
                        sprintf(buf,
                                "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr="
                                "%pM)",
                                auth_type - 1,
-                               eth_hdr->
-                               h_dest[0] & 0x01 ? "broad" :
-                               "uni", eth_hdr->h_source);
+                               eth_hdr->h_dest[0] & 0x01 ? "broad" : "uni",
+                               eth_hdr->h_source);
                        memset(&wrqu, 0, sizeof(wrqu));
                        wrqu.data.length = strlen(buf);
-                       DPRINTK(4,
-                               "IWEVENT:MICHAELMICFAILURE\n");
-                       wireless_send_event(priv->net_dev,
-                                       IWEVCUSTOM, &wrqu,
-                                       buf);
+                       DPRINTK(4, "IWEVENT:MICHAELMICFAILURE\n");
+                       wireless_send_event(priv->net_dev, IWEVCUSTOM, &wrqu,
+                                           buf);
                        return -EINVAL;
-
                }
        }
        return 0;
 }
 
-
 static
 void hostif_data_indication(struct ks_wlan_private *priv)
 {