diff mbox

[OPW,kernel,13/13] staging: rtl8187se: use netdev_warn instead of printk

Message ID 1382316061-31542-14-git-send-email-teobaluta@gmail.com
State New, archived
Headers show

Commit Message

Teodora Baluta Oct. 21, 2013, 12:41 a.m. UTC
This patch fixes this type of checkpatch warnings:

WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then
pr_warn(...  to printk(KERN_WARNING ...

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Josh Triplett Oct. 21, 2013, 7:09 p.m. UTC | #1
On Mon, Oct 21, 2013 at 03:41:01AM +0300, Teodora Baluta wrote:
> This patch fixes this type of checkpatch warnings:
> 
> WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then
> pr_warn(...  to printk(KERN_WARNING ...
> 
> Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
> ---

As with previous patches: netdev_* will print the dev name for you
already, so drop the bit that prints the dev name.

- Josh Triplett
diff mbox

Patch

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index ab07f0b..5b85cf9 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -343,8 +343,8 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 	     !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)) ||
 	    ((!ieee->softmac_data_hard_start_xmit &&
 	      (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
-		printk(KERN_WARNING "%s: No xmit handler.\n",
-		       ieee->dev->name);
+		netdev_warn(ieee->dev, "%s: No xmit handler.\n",
+			    ieee->dev->name);
 		goto success;
 	}
 
@@ -352,8 +352,8 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 	if (likely(ieee->raw_tx == 0)) {
 
 		if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
-			printk(KERN_WARNING "%s: skb too small (%d).\n",
-			ieee->dev->name, skb->len);
+			netdev_warn(ieee->dev, "%s: skb too small (%d).\n",
+				    ieee->dev->name, skb->len);
 			goto success;
 		}
 
@@ -476,8 +476,8 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 		 */
 		txb = ieee80211_alloc_txb(nr_frags, frag_size, GFP_ATOMIC);
 		if (unlikely(!txb)) {
-			printk(KERN_WARNING "%s: Could not allocate TXB\n",
-			ieee->dev->name);
+			netdev_warn(ieee->dev, "%s: Could not allocate TXB\n",
+				    ieee->dev->name);
 			goto failed;
 		}
 		txb->encrypted = encrypt;
@@ -555,15 +555,15 @@  int ieee80211_rtl_xmit(struct sk_buff *skb,
 		}
 	} else {
 		if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
-			printk(KERN_WARNING "%s: skb too small (%d).\n",
+			netdev_warn(ieee->dev, "%s: skb too small (%d).\n",
 			ieee->dev->name, skb->len);
 			goto success;
 		}
 
 		txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
 		if (!txb) {
-			printk(KERN_WARNING "%s: Could not allocate TXB\n",
-			ieee->dev->name);
+			netdev_warn(ieee->dev, "%s: Could not allocate TXB\n",
+				    ieee->dev->name);
 			goto failed;
 		}