Skip to contentSkip to conversation

Staging: rtl8192u: ieee80211: pr_warn instead printk

PATCH Superseded Hatice ERTÜRK 2 participants 2 messages Mar 6, 2015 Staging

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 32/32 Staging: rtl8192u: ieee80211: pr_warn instead printk

This patch fixes the following warning using checkpatch.pl
WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...

---
v3:
Changed usage dev_functions.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +7 -7
index ecd8542..8d4ade4 100644
@@ -197,7 +197,7 @@ int ieee80211_encrypt_fragment(
 			struct ieee80211_hdr_3addrqos *header;
 
 			header = (struct ieee80211_hdr_3addrqos *)frag->data;
-			dev_debug(KERN_DEBUG "%s: TKIP countermeasures: dropped "
+			dev_debug("%s: TKIP countermeasures: dropped "
 			       "TX packet to %pM\n",
 			       ieee->dev->name, header->addr1);
 		}
@@ -219,7 +219,7 @@ int ieee80211_encrypt_fragment(
 
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		dev_info(KERN_INFO "%s: Encryption failed: len=%d.\n",
+		dev_info("%s: Encryption failed: len=%d.\n",
 		       ieee->dev->name, frag->len);
 		ieee->ieee_stats.tx_discards++;
 		return -1;
@@ -623,7 +623,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * creating it... */
 	if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))||
 	   ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
-		dev_warn(KERN_WARNING "%s: No xmit handler.\n",
+		dev_warn("%s: No xmit handler.\n",
 		       ieee->dev->name);
 		goto success;
 	}
@@ -631,7 +631,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if(likely(ieee->raw_tx == 0)){
 		if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
-			dev_warn(KERN_WARNING "%s: skb too small (%d).\n",
+			dev_warn("%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
 			goto success;
 		}
@@ -747,7 +747,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 		* postfix, header, FCS, etc.) */
 		txb = ieee80211_alloc_txb(nr_frags, frag_size + ieee->tx_headroom, GFP_ATOMIC);
 		if (unlikely(!txb)) {
-			dev_warn(KERN_WARNING "%s: Could not allocate TXB\n",
+			dev_warn("%s: Could not allocate TXB\n",
 			ieee->dev->name);
 			goto failed;
 		}
@@ -846,14 +846,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}else{
 		if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
-			dev_warn(KERN_WARNING "%s: skb too small (%d).\n",
+			dev_warn("%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
 			goto success;
 		}
 
 		txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
 		if(!txb){
-			dev_warn(KERN_WARNING "%s: Could not allocate TXB\n",
+			dev_warn("%s: Could not allocate TXB\n",
 			ieee->dev->name);
 			goto failed;
 		}
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · Hatice ERTÜRK

This patch fixes the following warning using checkpatch.pl
WARNING: Prefer [subsystem eg: netdev]_warn([subsystem]dev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ...

---
v3:
Changed usage dev_functions.

---
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +0 -0
index ecd8542..8d4ade4 100644

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c int ieee80211_encrypt_fragment( · line 200

Quoted 5 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +1 -1
@@ -197,7 +197,7 @@ int ieee80211_encrypt_fragment(
 			struct ieee80211_hdr_3addrqos *header;
 
 			header = (struct ieee80211_hdr_3addrqos *)frag->data;
-			dev_debug(KERN_DEBUG "%s: TKIP countermeasures: dropped "
+			dev_debug("%s: TKIP countermeasures: dropped "

Please ensure that your code compiles. This call is not correct,

Also, I have the impression that this patch is against your previous patch. It should be against the original state of the code.

Finally, please explain why a netdev function cannot be used. This is a network driver.

julia

Quoted 66 lines
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +6 -7
 			       "TX packet to %pM\n",
 			       ieee->dev->name, header->addr1);
 		}
@@ -219,7 +219,7 @@ int ieee80211_encrypt_fragment(
 
 	atomic_dec(&crypt->refcnt);
 	if (res < 0) {
-		dev_info(KERN_INFO "%s: Encryption failed: len=%d.\n",
+		dev_info("%s: Encryption failed: len=%d.\n",
 		       ieee->dev->name, frag->len);
 		ieee->ieee_stats.tx_discards++;
 		return -1;
@@ -623,7 +623,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 	 * creating it... */
 	if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))||
 	   ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
-		dev_warn(KERN_WARNING "%s: No xmit handler.\n",
+		dev_warn("%s: No xmit handler.\n",
 		       ieee->dev->name);
 		goto success;
 	}
@@ -631,7 +631,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if(likely(ieee->raw_tx == 0)){
 		if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
-			dev_warn(KERN_WARNING "%s: skb too small (%d).\n",
+			dev_warn("%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
 			goto success;
 		}
@@ -747,7 +747,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 		* postfix, header, FCS, etc.) */
 		txb = ieee80211_alloc_txb(nr_frags, frag_size + ieee->tx_headroom, GFP_ATOMIC);
 		if (unlikely(!txb)) {
-			dev_warn(KERN_WARNING "%s: Could not allocate TXB\n",
+			dev_warn("%s: Could not allocate TXB\n",
 			ieee->dev->name);
 			goto failed;
 		}
@@ -846,14 +846,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
 		}
 	}else{
 		if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
-			dev_warn(KERN_WARNING "%s: skb too small (%d).\n",
+			dev_warn("%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
 			goto success;
 		}
 
 		txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
 		if(!txb){
-			dev_warn(KERN_WARNING "%s: Could not allocate TXB\n",
+			dev_warn("%s: Could not allocate TXB\n",
 			ieee->dev->name);
 			goto failed;
 		}
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1425651329-14574-1-git-send-email-haticeerturk27%40gmail.com.
For more options, visit https://groups.google.com/d/optout.