Skip to contentSkip to conversation

Staging: rtl8192u: Replace printk() with pr_debug()

PATCH Superseded Ksenija Stanojevic 2 participants 4 messages Feb 22, 2015 – Feb 23, 2015

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rtl8192u: Replace printk() with pr_debug()

For dynamic debugging pr_debug() macro is preferred over printk(), which is the raw way to print something. Issue found by checkpatch.pl.

---
 drivers/dma/ste_dma40.c                                  | 1 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/dma/ste_dma40.c +1 -0
index 15d4946..8adae93 100644
@@ -23,6 +23,7 @@
 #include <linux/amba/bus.h>
 #include <linux/regulator/consumer.h>
 #include <linux/platform_data/dma-ste-dma40.h>
+#include <linux/sizes.h>
 
 #include "dmaengine.h"
 #include "ste_dma40_ll.h"
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +2 -2
index 8c1bf1f..7fab680 100644
@@ -49,14 +49,14 @@ static void *prism2_wep_init(int keyidx)
 
 	priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm)) {
-		printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+		pr_debug("ieee80211_crypt_wep: could not allocate "
 		       "crypto API arc4\n");
 		priv->tx_tfm = NULL;
 		goto fail;
 	}
 	priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm)) {
-		printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+		pr_debug("ieee80211_crypt_wep: could not allocate "
 		       "crypto API arc4\n");
 		priv->rx_tfm = NULL;
 		goto fail;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Ksenija Stanojevic

For dynamic debugging pr_debug() macro is preferred over printk(), which is the raw way to print something. Issue found by checkpatch.pl.

---
 drivers/dma/ste_dma40.c                                  | 1 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

The fix to rtl8192u is correct, but you managed to include a change to drivers/dma/ste_dma40.c in the same patch. That is not good - you need to repost a v2, which only includes the rtl8192u changes.

Cheers,
Jes

Quoted 34 lines
drivers/dma/ste_dma40.c +1 -0
index 15d4946..8adae93 100644
@@ -23,6 +23,7 @@
 #include <linux/amba/bus.h>
 #include <linux/regulator/consumer.h>
 #include <linux/platform_data/dma-ste-dma40.h>
+#include <linux/sizes.h>
 
 #include "dmaengine.h"
 #include "ste_dma40_ll.h"
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +2 -2
index 8c1bf1f..7fab680 100644
@@ -49,14 +49,14 @@ static void *prism2_wep_init(int keyidx)
 
 	priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->tx_tfm)) {
-		printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+		pr_debug("ieee80211_crypt_wep: could not allocate "
 		       "crypto API arc4\n");
 		priv->tx_tfm = NULL;
 		goto fail;
 	}
 	priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
 	if (IS_ERR(priv->rx_tfm)) {
-		printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+		pr_debug("ieee80211_crypt_wep: could not allocate "
 		       "crypto API arc4\n");
 		priv->rx_tfm = NULL;
 		goto fail;
#2 lore raw

Ok, thank you for telling me. i didn't notice that I included changes to both files!

Quoted 53 lines · Jes Sorensen
Quoted 8 lines · Ksenija Stanojevic

For dynamic debugging pr_debug() macro is preferred over printk(), which is the raw way to print something. Issue found by checkpatch.pl.

---
 drivers/dma/ste_dma40.c                                  | 1 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

The fix to rtl8192u is correct, but you managed to include a change to drivers/dma/ste_dma40.c in the same patch. That is not good - you need to repost a v2, which only includes the rtl8192u changes.

Cheers,
Jes

Quoted 34 lines
drivers/dma/ste_dma40.c +1 -0
index 15d4946..8adae93 100644
@@ -23,6 +23,7 @@
 #include <linux/amba/bus.h>
 #include <linux/regulator/consumer.h>
 #include <linux/platform_data/dma-ste-dma40.h>
+#include <linux/sizes.h>
 
 #include "dmaengine.h"
 #include "ste_dma40_ll.h"
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +2 -2
index 8c1bf1f..7fab680 100644
@@ -49,14 +49,14 @@ static void *prism2_wep_init(int keyidx)
 
      priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
      if (IS_ERR(priv->tx_tfm)) {
-             printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+             pr_debug("ieee80211_crypt_wep: could not allocate "
                     "crypto API arc4\n");
              priv->tx_tfm = NULL;
              goto fail;
      }
      priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
      if (IS_ERR(priv->rx_tfm)) {
-             printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+             pr_debug("ieee80211_crypt_wep: could not allocate "
                     "crypto API arc4\n");
              priv->rx_tfm = NULL;
              goto fail;
#3 lore raw
Quoted 2 lines · Ksenija Stanojević

Ok, thank you for telling me. i didn't notice that I included changes to both files!

It is a good idea to inspect patch files visually before you post them to catch such things.

Again here, please do not top-post replies in email.

Cheers,
Jes

Quoted 54 lines · Jes Sorensen
Quoted 53 lines · Ksenija Stanojevic
Quoted 8 lines

For dynamic debugging pr_debug() macro is preferred over printk(), which is the raw way to print something. Issue found by checkpatch.pl.

---
 drivers/dma/ste_dma40.c                                  | 1 +
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

The fix to rtl8192u is correct, but you managed to include a change to drivers/dma/ste_dma40.c in the same patch. That is not good - you need to repost a v2, which only includes the rtl8192u changes.

Cheers,
Jes

Quoted 34 lines
drivers/dma/ste_dma40.c +1 -0
index 15d4946..8adae93 100644
@@ -23,6 +23,7 @@
 #include <linux/amba/bus.h>
 #include <linux/regulator/consumer.h>
 #include <linux/platform_data/dma-ste-dma40.h>
+#include <linux/sizes.h>
 
 #include "dmaengine.h"
 #include "ste_dma40_ll.h"
drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +2 -2
index 8c1bf1f..7fab680 100644
@@ -49,14 +49,14 @@ static void *prism2_wep_init(int keyidx)
 
      priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
      if (IS_ERR(priv->tx_tfm)) {
-             printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+             pr_debug("ieee80211_crypt_wep: could not allocate "
                     "crypto API arc4\n");
              priv->tx_tfm = NULL;
              goto fail;
      }
      priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
      if (IS_ERR(priv->rx_tfm)) {
-             printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
+             pr_debug("ieee80211_crypt_wep: could not allocate "
                     "crypto API arc4\n");
              priv->rx_tfm = NULL;
              goto fail;