Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livep...
[firefly-linux-kernel-4.4.55.git] / drivers / staging / rtl8192e / rtllib_crypt_ccmp.c
index 01f85db98e0d2091702c8af3d6a0a38be4f1d3bc..7d486e8887f84cd8c3bf8b9538b29195999e07a2 100644 (file)
@@ -69,8 +69,7 @@ static void *rtllib_ccmp_init(int key_idx)
 
        priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
        if (IS_ERR(priv->tfm)) {
-               pr_debug("rtllib_crypt_ccmp: could not allocate "
-                      "crypto API aes\n");
+               pr_debug("rtllib_crypt_ccmp: could not allocate crypto API aes\n");
                priv->tfm = NULL;
                goto fail;
        }
@@ -121,10 +120,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
        fc = le16_to_cpu(hdr->frame_ctl);
        a4_included = ((fc & (RTLLIB_FCTL_TODS | RTLLIB_FCTL_FROMDS)) ==
                       (RTLLIB_FCTL_TODS | RTLLIB_FCTL_FROMDS));
-       /*
-       qc_included = ((WLAN_FC_GET_TYPE(fc) == RTLLIB_FTYPE_DATA) &&
-                      (WLAN_FC_GET_STYPE(fc) & 0x08));
-       */
+
        qc_included = ((WLAN_FC_GET_TYPE(fc) == RTLLIB_FTYPE_DATA) &&
                       (WLAN_FC_GET_STYPE(fc) & 0x80));
        aad_len = 22;
@@ -141,7 +137,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
         * Flag (Include authentication header, M=3 (8-octet MIC),
         *       L=1 (2-octet Dlen))
         * Nonce: 0x00 | A2 | PN
-        * Dlen */
+        * Dlen
+        */
        b0[0] = 0x59;
        b0[1] = qc;
        memcpy(b0 + 2, hdr->addr2, ETH_ALEN);
@@ -278,23 +275,22 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
        keyidx = pos[3];
        if (!(keyidx & (1 << 5))) {
                if (net_ratelimit()) {
-                       pr_debug("CCMP: received packet without ExtIV"
-                              " flag from %pM\n", hdr->addr2);
+                       pr_debug("CCMP: received packet without ExtIV flag from %pM\n",
+                                hdr->addr2);
                }
                key->dot11RSNAStatsCCMPFormatErrors++;
                return -2;
        }
        keyidx >>= 6;
        if (key->key_idx != keyidx) {
-               pr_debug("CCMP: RX tkey->key_idx=%d frame "
-                      "keyidx=%d priv=%p\n", key->key_idx, keyidx, priv);
+               pr_debug("CCMP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
+                        key->key_idx, keyidx, priv);
                return -6;
        }
        if (!key->key_set) {
                if (net_ratelimit()) {
-                       pr_debug("CCMP: received packet from %pM"
-                              " with keyid=%d that does not have a configured"
-                              " key\n", hdr->addr2, keyidx);
+                       pr_debug("CCMP: received packet from %pM with keyid=%d that does not have a configured key\n",
+                                hdr->addr2, keyidx);
                }
                return -3;
        }
@@ -341,8 +337,8 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
                if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
                        if (net_ratelimit()) {
-                               pr_debug("CCMP: decrypt failed: STA="
-                               " %pM\n", hdr->addr2);
+                               pr_debug("CCMP: decrypt failed: STA= %pM\n",
+                                        hdr->addr2);
                        }
                        key->dot11RSNAStatsCCMPDecryptErrors++;
                        return -5;
@@ -419,9 +415,7 @@ static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
        struct rtllib_ccmp_data *ccmp = priv;
 
        seq_printf(m,
-                  "key[%d] alg=CCMP key_set=%d "
-                  "tx_pn=%pM rx_pn=%pM "
-                  "format_errors=%d replays=%d decrypt_errors=%d\n",
+                  "key[%d] alg=CCMP key_set=%d tx_pn=%pM rx_pn=%pM format_errors=%d replays=%d decrypt_errors=%d\n",
                   ccmp->key_idx, ccmp->key_set,
                   ccmp->tx_pn, ccmp->rx_pn,
                   ccmp->dot11RSNAStatsCCMPFormatErrors,