diff mbox

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

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

Commit Message

Teodora Baluta Oct. 21, 2013, 11:37 p.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>

---
Changes since v1:
* delete prefix that prints the dev name
---
 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Comments

Josh Triplett Oct. 21, 2013, 11:51 p.m. UTC | #1
On Tue, Oct 22, 2013 at 02:37:24AM +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>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> ---
> Changes since v1:
> * delete prefix that prints the dev name
> ---
>  drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |   15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> index ba32df9..f5a5219 100644
> --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
> @@ -341,8 +341,7 @@ 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, "No xmit handler.\n");
>  		goto success;
>  	}
>  
> @@ -350,8 +349,7 @@ 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, "skb too small (%d).\n", skb->len);
>  			goto success;
>  		}
>  
> @@ -475,8 +473,7 @@ 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, "Could not allocate TXB\n");
>  			goto failed;
>  		}
>  		txb->encrypted = encrypt;
> @@ -555,15 +552,13 @@ 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",
> -			ieee->dev->name, skb->len);
> +			netdev_warn(ieee->dev, "skb too small (%d).\n", 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, "Could not allocate TXB\n");
>  			goto failed;
>  		}
>  
> -- 
> 1.7.10.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
diff mbox

Patch

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index ba32df9..f5a5219 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -341,8 +341,7 @@  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, "No xmit handler.\n");
 		goto success;
 	}
 
@@ -350,8 +349,7 @@  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, "skb too small (%d).\n", skb->len);
 			goto success;
 		}
 
@@ -475,8 +473,7 @@  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, "Could not allocate TXB\n");
 			goto failed;
 		}
 		txb->encrypted = encrypt;
@@ -555,15 +552,13 @@  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",
-			ieee->dev->name, skb->len);
+			netdev_warn(ieee->dev, "skb too small (%d).\n", 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, "Could not allocate TXB\n");
 			goto failed;
 		}