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>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 13/21] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Date: Mon, 13 Apr 2015 23:47:36 +0200	[thread overview]
Message-ID: <1428961664-4241-14-git-send-email-mateusz.kulikowski@gmail.com> (raw)
In-Reply-To: <1428961664-4241-1-git-send-email-mateusz.kulikowski@gmail.com>

Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
Replace printk() with pr_* where possible.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
 drivers/staging/rtl8192e/rtllib.h            |  4 +-
 drivers/staging/rtl8192e/rtllib_crypt.c      | 17 ++++----
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 59 +++++++++++-----------------
 drivers/staging/rtl8192e/rtllib_rx.c         |  4 +-
 4 files changed, 34 insertions(+), 50 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 472e880..fd7b7a5 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -685,13 +685,13 @@ extern u32 rtllib_debug_level;
 #define RTLLIB_DEBUG(level, fmt, args...) \
 do {								\
 	if (rtllib_debug_level & (level))			\
-		printk(KERN_DEBUG "rtllib: " fmt, ## args);	\
+		pr_debug("rtllib: " fmt, ## args);	\
 } while (0)
 
 #define RTLLIB_DEBUG_DATA(level, data, datalen)	\
 	do {							\
 		if ((rtllib_debug_level & (level)) == (level)) {	\
-			printk(KERN_DEBUG "rtllib: %s()\n", __func__);	\
+			pr_debug("rtllib: %s()\n", __func__);	\
 			print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \
 					     data, datalen); \
 		}					\
diff --git a/drivers/staging/rtl8192e/rtllib_crypt.c b/drivers/staging/rtl8192e/rtllib_crypt.c
index 1e6ae9b..80711ee 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt.c
@@ -62,9 +62,8 @@ void rtllib_crypt_deinit_handler(unsigned long data)
 	spin_lock_irqsave(info->lock, flags);
 	rtllib_crypt_deinit_entries(info, 0);
 	if (!list_empty(&info->crypt_deinit_list)) {
-		printk(KERN_DEBUG
-		       "%s: entries remaining in delayed crypt deletion list\n",
-		       info->name);
+		pr_debug("%s: entries remaining in delayed crypt deletion list\n",
+			 info->name);
 		info->crypt_deinit_timer.expires = jiffies + HZ;
 		add_timer(&info->crypt_deinit_timer);
 	}
@@ -118,8 +117,7 @@ int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops)
 	list_add(&alg->list, &hcrypt->algs);
 	spin_unlock_irqrestore(&hcrypt->lock, flags);
 
-	printk(KERN_DEBUG "rtllib_crypt: registered algorithm '%s'\n",
-	       ops->name);
+	pr_debug("rtllib_crypt: registered algorithm '%s'\n", ops->name);
 
 	return 0;
 }
@@ -147,8 +145,8 @@ int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops)
 	spin_unlock_irqrestore(&hcrypt->lock, flags);
 
 	if (del_alg) {
-		printk(KERN_DEBUG "rtllib_crypt: unregistered algorithm '%s'\n",
-		       ops->name);
+		pr_debug("rtllib_crypt: unregistered algorithm '%s'\n",
+			 ops->name);
 		kfree(del_alg);
 	}
 
@@ -239,9 +237,8 @@ void __exit rtllib_crypto_deinit(void)
 		struct rtllib_crypto_alg *alg =
 			(struct rtllib_crypto_alg *) ptr;
 		list_del(ptr);
-		printk(KERN_DEBUG
-		       "rtllib_crypt: unregistered algorithm '%s' (deinit)\n",
-		       alg->ops->name);
+		pr_debug("rtllib_crypt: unregistered algorithm '%s' (deinit)\n",
+			 alg->ops->name);
 		kfree(alg);
 	}
 
diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
index c3eed40..8fe2ec2 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
@@ -66,8 +66,7 @@ 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("rtllib_crypt_tkip: could not allocate crypto API arc4\n");
 		priv->tx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -75,8 +74,7 @@ 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("rtllib_crypt_tkip: could not allocate crypto API michael_mic\n");
 		priv->tx_tfm_michael = NULL;
 		goto fail;
 	}
@@ -84,8 +82,7 @@ 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("rtllib_crypt_tkip: could not allocate crypto API arc4\n");
 		priv->rx_tfm_arc4 = NULL;
 		goto fail;
 	}
@@ -93,8 +90,7 @@ 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("rtllib_crypt_tkip: could not allocate crypto API michael_mic\n");
 		priv->rx_tfm_michael = NULL;
 		goto fail;
 	}
@@ -401,24 +397,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("TKIP: received packet without ExtIV flag from %pM\n",
+				 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("TKIP: RX tkey->key_idx=%d frame keyidx=%d priv=%p\n",
+			 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("TKIP: received packet from %pM with keyid=%d that does not have a configured key\n",
+				 hdr->addr2, keyidx);
 		}
 		return -3;
 	}
@@ -431,10 +424,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("TKIP: replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n",
+					 hdr->addr2, tkey->rx_iv32, tkey->rx_iv16,
+					 iv32, iv16);
 			}
 			tkey->dot11RSNAStatsTKIPReplays++;
 			return -4;
@@ -455,9 +447,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(": TKIP: failed to decrypt received packet from %pM\n",
+					 hdr->addr2);
 			}
 			return -7;
 		}
@@ -477,9 +468,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("TKIP: ICV error detected: STA= %pM\n",
+					 hdr->addr2);
 			}
 			tkey->dot11RSNAStatsTKIPICVErrors++;
 			return -5;
@@ -564,9 +554,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("Invalid packet for Michael MIC add (tailroom=%d hdr_len=%d skb->len=%d)\n",
+			 skb_tailroom(skb), hdr_len, skb->len);
 		return -1;
 	}
 
@@ -628,12 +617,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 0030f33..3118ef5 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -344,8 +344,8 @@ 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);
+		pr_debug("%s: MSDU decryption/MIC verification failed (SA= %pM keyidx=%d)\n",
+			 ieee->dev->name, hdr->addr2, keyidx);
 		return -1;
 	}
 
-- 
1.8.4.1


  parent reply	other threads:[~2015-04-13 21:48 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 21:47 [PATCH v2 00/21] staging: rtl8192e: Fix more checkpatch.pl warnings Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 01/21] staging: rtl8192e: Fix SPACE_BEFORE_TAB warnings Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 02/21] staging: rtl8192e: Copy comments from r819XE_phyreg.h to r8192E_phyreg.h Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 03/21] staging: rtl8192e: remove r819xE_phyreg.h Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 04/21] staging: rtl8192e: Fix SPACING errors Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 05/21] staging: rtl8192e: Remove bb tx gains from r8192_priv Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 06/21] staging: rtl8192e: Fix LINE_SPACING warning Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 07/21] staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 08/21] staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtl_dm.c Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 09/21] staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned() Mateusz Kulikowski
2015-04-14  8:00   ` Dan Carpenter
2015-04-15 21:08     ` Mateusz Kulikowski
2015-04-15 21:36       ` Joe Perches
2015-05-03 19:10   ` Greg KH
2015-05-03 19:17     ` Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 11/21] staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 12/21] staging: rtl8192e: replace memcmp() with ether_addr_equal_unaligned() Mateusz Kulikowski
2015-04-13 21:47 ` Mateusz Kulikowski [this message]
2015-04-14  8:07   ` [PATCH v2 13/21] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings Dan Carpenter
2015-04-15 21:27     ` Mateusz Kulikowski
2015-04-14  8:09   ` Dan Carpenter
2015-04-13 21:47 ` [PATCH v2 14/21] staging: rtl8192e: Fix LONG_LINE warnings Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 15/21] staging: rtl8192e: Fix LONG_LINE warnings - modify variables Mateusz Kulikowski
2015-04-14  8:40   ` Dan Carpenter
2015-04-15 21:56     ` Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 16/21] staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 17/21] staging: rtl8192e: Fix LONG_LINE warnings (conditions) Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 18/21] staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 19/21] staging: rtl8192e: Fix LONG_LINE in rtllib_parse_mife_generic() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 20/21] staging: rtl8192e: Fix LONG_LINE in simplify rtl8192_process_phyinfo() Mateusz Kulikowski
2015-04-13 21:47 ` [PATCH v2 21/21] staging: rtl8192e: Remove unimplemented iwpriv handlers Mateusz Kulikowski
2015-04-13 22:12 ` [PATCH v2 00/21] staging: rtl8192e: Fix more checkpatch.pl warnings Dan Carpenter
2015-04-13 22:15   ` Mateusz Kulikowski
2015-04-13 22:33     ` Dan Carpenter
2015-04-13 22:39       ` 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=1428961664-4241-14-git-send-email-mateusz.kulikowski@gmail.com \
    --to=mateusz.kulikowski@gmail.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®