mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
	dan.carpenter@oracle.com, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 20/33] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Date: Sat,  9 May 2015 23:19:08 +0200	[thread overview]
Message-ID: <1431206361-13736-21-git-send-email-mateusz.kulikowski@gmail.com> (raw)
In-Reply-To: <1431206361-13736-1-git-send-email-mateusz.kulikowski@gmail.com>

Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
Replace printk() with netdev_* if possible, pr_* in other cases.
All pr_* use __func__ to easily trace message back to rtllib

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_crypt_ccmp.c |  2 +-
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 63 ++++++++++++----------------
 drivers/staging/rtl8192e/rtllib_rx.c         |  5 ++-
 3 files changed, 31 insertions(+), 39 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
index 7d486e8..3b596b2 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_ccmp.c
@@ -69,7 +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("%s(): could not allocate crypto API aes\n", __func__);
 		priv->tfm = NULL;
 		goto fail;
 	}
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
index 9ec2b48..d4882a3 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
@@ -68,8 +68,8 @@ static void *rtllib_tkip_init(int key_idx)
 	priv->tx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
 			CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm_arc4)) {
-		printk(KERN_DEBUG
-		       "rtllib_crypt_tkip: could not allocate crypto API arc4\n");
+		pr_debug("%s(): could not allocate crypto API arc4\n",
+			 __func__);
 		priv->tx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -77,8 +77,8 @@ static void *rtllib_tkip_init(int key_idx)
 	priv->tx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
 			CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm_michael)) {
-		printk(KERN_DEBUG
-		       "rtllib_crypt_tkip: could not allocate crypto API michael_mic\n");
+		pr_debug("%s(): could not allocate crypto API michael_mic\n",
+			 __func__);
 		priv->tx_tfm_michael = NULL;
 		goto fail;
 	}
@@ -86,8 +86,8 @@ static void *rtllib_tkip_init(int key_idx)
 	priv->rx_tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0,
 			CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm_arc4)) {
-		printk(KERN_DEBUG
-		       "rtllib_crypt_tkip: could not allocate crypto API arc4\n");
+		pr_debug("%s(): could not allocate crypto API arc4\n",
+			 __func__);
 		priv->rx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -95,8 +95,8 @@ static void *rtllib_tkip_init(int key_idx)
 	priv->rx_tfm_michael = crypto_alloc_hash("michael_mic", 0,
 			CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm_michael)) {
-		printk(KERN_DEBUG
-		       "rtllib_crypt_tkip: could not allocate crypto API michael_mic\n");
+		pr_debug("%s: could not allocate crypto API michael_mic\n",
+			 __func__);
 		priv->rx_tfm_michael = NULL;
 		goto fail;
 	}
@@ -403,24 +403,21 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	keyidx = pos[3];
 	if (!(keyidx & (1 << 5))) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG
-			       "TKIP: received packet without ExtIV flag from %pM\n",
-			       hdr->addr2);
+			pr_debug("%s(): received packet without ExtIV flag from %pM\n",
+				 __func__, hdr->addr2);
 		}
 		return -2;
 	}
 	keyidx >>= 6;
 	if (tkey->key_idx != keyidx) {
-		printk(KERN_DEBUG
-		       "TKIP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
-		       tkey->key_idx, keyidx, priv);
+		pr_debug("%s(): RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
+			 __func__, tkey->key_idx, keyidx, priv);
 		return -6;
 	}
 	if (!tkey->key_set) {
 		if (net_ratelimit()) {
-			printk(KERN_DEBUG
-			       "TKIP: received packet from %pM with keyid=%d that does not have a configured key\n",
-			       hdr->addr2, keyidx);
+			pr_debug("%s(): received packet from %pM with keyid=%d that does not have a configured key\n",
+				 __func__, hdr->addr2, keyidx);
 		}
 		return -3;
 	}
@@ -433,10 +430,9 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 		    (iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) &&
 		    tkey->initialized) {
 			if (net_ratelimit()) {
-				printk(KERN_DEBUG
-				       "TKIP: replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n",
-				       hdr->addr2, tkey->rx_iv32, tkey->rx_iv16,
-				       iv32, iv16);
+				pr_debug("%s(): replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n",
+					 __func__, hdr->addr2, tkey->rx_iv32,
+					 tkey->rx_iv16, iv32, iv16);
 			}
 			tkey->dot11RSNAStatsTKIPReplays++;
 			return -4;
@@ -457,9 +453,8 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 		crypto_blkcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16);
 		if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) {
 			if (net_ratelimit()) {
-				printk(KERN_DEBUG
-				       ": TKIP: failed to decrypt received packet from %pM\n",
-				       hdr->addr2);
+				pr_debug("%s(): failed to decrypt received packet from %pM\n",
+					 __func__, hdr->addr2);
 			}
 			return -7;
 		}
@@ -479,9 +474,8 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 				tkey->rx_phase1_done = 0;
 			}
 			if (net_ratelimit()) {
-				printk(KERN_DEBUG
-				       "TKIP: ICV error detected: STA= %pM\n",
-				       hdr->addr2);
+				pr_debug("%s(): ICV error detected: STA= %pM\n",
+					 __func__, hdr->addr2);
 			}
 			tkey->dot11RSNAStatsTKIPICVErrors++;
 			return -5;
@@ -566,9 +560,8 @@ static int rtllib_michael_mic_add(struct sk_buff *skb, int hdr_len, void *priv)
 	hdr = (struct rtllib_hdr_4addr *) skb->data;
 
 	if (skb_tailroom(skb) < 8 || skb->len < hdr_len) {
-		printk(KERN_DEBUG
-		       "Invalid packet for Michael MIC add (tailroom=%d hdr_len=%d skb->len=%d)\n",
-		       skb_tailroom(skb), hdr_len, skb->len);
+		pr_debug("%s(): Invalid packet for Michael MIC add (tailroom=%d hdr_len=%d skb->len=%d)\n",
+			 __func__, skb_tailroom(skb), hdr_len, skb->len);
 		return -1;
 	}
 
@@ -630,12 +623,10 @@ static int rtllib_michael_mic_verify(struct sk_buff *skb, int keyidx,
 		struct rtllib_hdr_4addr *hdr;
 
 		hdr = (struct rtllib_hdr_4addr *) skb->data;
-		printk(KERN_DEBUG
-		       "%s: Michael MIC verification failed for MSDU from %pM keyidx=%d\n",
-		       skb->dev ? skb->dev->name : "N/A", hdr->addr2,
-		       keyidx);
-		printk(KERN_DEBUG "%d\n",
-		       memcmp(mic, skb->data + skb->len - 8, 8) != 0);
+		pr_debug("%s: Michael MIC verification failed for MSDU from %pM keyidx=%d\n",
+			 skb->dev ? skb->dev->name : "N/A", hdr->addr2,
+			 keyidx);
+		pr_debug("%d\n", memcmp(mic, skb->data + skb->len - 8, 8) != 0);
 		if (skb->dev) {
 			pr_info("skb->dev != NULL\n");
 			rtllib_michael_mic_failure(skb->dev, hdr, keyidx);
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index f5d3e2a..5aaefd7 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -346,8 +346,9 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
 	res = crypt->ops->decrypt_msdu(skb, keyidx, hdrlen, crypt->priv);
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed (SA= %pM keyidx=%d)\n",
-		       ieee->dev->name, hdr->addr2, keyidx);
+		netdev_dbg(ieee->dev,
+			   "MSDU decryption/MIC verification failed (SA= %pM keyidx=%d)\n",
+			   hdr->addr2, keyidx);
 		return -1;
 	}
 
-- 
1.8.4.1


  parent reply	other threads:[~2015-05-09 21:23 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-09 21:18 [PATCH v3 00/33] staging: rtl8192e: Fix more checkpatch.pl warnings Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 01/33] staging: rtl8192e: Declare ethernet addresses as __aligned(2) Mateusz Kulikowski
2015-05-09 22:29   ` Joe Perches
2015-05-12 19:44     ` Mateusz Kulikowski
2015-05-12 19:53       ` Joe Perches
2015-05-09 21:18 ` [PATCH v3 02/33] staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings Mateusz Kulikowski
2015-05-10 13:19   ` Greg KH
2015-05-12 19:52     ` Mateusz Kulikowski
2015-05-12 21:19       ` Greg KH
2015-05-14 20:22         ` Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 03/33] staging: rtl8192e: Mark unaligned memcpy() Mateusz Kulikowski
2015-05-10 13:20   ` Greg KH
2015-05-12 20:05     ` Mateusz Kulikowski
2015-05-11  8:26   ` Dan Carpenter
2015-05-12 20:00     ` Mateusz Kulikowski
2015-05-13  8:22       ` Dan Carpenter
2015-05-14 20:29         ` Mateusz Kulikowski
2015-05-14 23:14           ` Dan Carpenter
2015-05-17 20:38             ` Mateusz Kulikowski
2015-05-18  9:09               ` Dan Carpenter
2015-05-09 21:18 ` [PATCH v3 04/33] staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param() Mateusz Kulikowski
2015-05-10  7:49   ` Sudip Mukherjee
2015-05-12 21:01     ` Mateusz Kulikowski
2015-05-13  4:45       ` Sudip Mukherjee
2015-05-13  8:26       ` Dan Carpenter
2015-05-11 13:48   ` Dan Carpenter
2015-05-12 20:46     ` Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 05/33] staging: rtl8192e: Replace memcmp() with ether_addr_equal_unaligned() Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 06/33] staging: rtl8192e: Remove rtllib_crypt.[ch] Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 07/33] staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*() Mateusz Kulikowski
2015-05-10  7:53   ` Sudip Mukherjee
2015-05-12 20:43     ` Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 08/33] staging: rtl8192e: Remove RTLLIB_ERROR() and RTLLIB_WARNING() Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 09/33] staging: rtl8192e: Remove RTLLIB_DEBUG_WX() Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 10/33] staging: rtl8192e: Simplify rtllib_proces_probe_response() Mateusz Kulikowski
2015-05-09 21:18 ` [PATCH v3 11/33] staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 12/33] staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 13/33] staging: rtl8192e: Remove RTLLIB_DEBUG_QOS() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 14/33] staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 15/33] staging: rtl8192e: Remove RTLLIB_DEBUG_INFO() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 16/33] staging: rtl8192e: Remove RTLLIB_DEBUG() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 17/33] staging: rtl8192e: Remove RTLLIB_DEBUG_DATA() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 18/33] staging: rtl8192e: Remove remains of RTLLIB_*_DEBUG() (including proc entry) Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 19/33] staging: rtl8192e: Remove assert() macro Mateusz Kulikowski
2015-05-09 21:19 ` Mateusz Kulikowski [this message]
2015-05-09 22:37   ` [PATCH v3 20/33] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings Joe Perches
2015-05-12 20:20     ` Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 21/33] staging: rtl8192e: Fix LONG_LINE warnings Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 22/33] staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param() Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 23/33] staging: rtl8192e: Remove unimplemented iwpriv handlers Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 24/33] staging: rtl8192e: Fix OOM_MESSAGE warnings Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 25/33] staging: rtl8192e: Remove unused rtl_crypto.h Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 26/33] staging: rtl8192e: Replace ?: with max_t Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 27/33] staging: rtl8192e: Replace ?: with min_t Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 28/33] staging: rtl8192e: Replace ?: with max Mateusz Kulikowski
2015-05-11 13:22   ` Dan Carpenter
2015-05-12 20:08     ` Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 29/33] staging: rtl8192e: Remove unneeded RT_TRACE(COMP_ERR,...) Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 30/33] staging: rtl8192e: rtl8192_phy_checkBBAndRF(): Don't check MAC Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 31/33] staging: rtl8192e: Replace RT_TRACE(COMP_ERR, ...) with netdev_* Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 32/33] staging: rtl8192e: Fix trivial LONG_LINE errors Mateusz Kulikowski
2015-05-09 21:19 ` [PATCH v3 33/33] staging: rtl8192e: rtl8192E_suspend(): Fix WOL reporting Mateusz Kulikowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431206361-13736-21-git-send-email-mateusz.kulikowski@gmail.com \
    --to=mateusz.kulikowski@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®