Skip to content

Commit 6a56933

Browse files
Sam Muhammedgregkh
authored andcommitted
Staging: rtl8192u: ieee80211: Use netdev_warn() for network devices.
Use netdev_warn() over printk(). netdev_warn() is specific for printing warning messages for network devices, and preferable over printk(KERN_WARNING ...). Signed-off-by: Sam Muhammed <[email protected]> Link: https://lore.kernel.org/r/02fe0666cb737a3b0581081c9e7c179bfb820cac.1585233434.git.jane.pnx9@gmail.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ea7a10e commit 6a56933

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

drivers/staging/rtl8192u/ieee80211/ieee80211_module.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
6868
sizeof(struct ieee80211_network),
6969
GFP_KERNEL);
7070
if (!ieee->networks) {
71-
printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
72-
ieee->dev->name);
71+
netdev_warn(ieee->dev, "Out of memory allocating beacons\n");
7372
return -ENOMEM;
7473
}
7574

drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -556,16 +556,15 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
556556
*/
557557
if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)) ||
558558
((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) {
559-
printk(KERN_WARNING "%s: No xmit handler.\n",
560-
ieee->dev->name);
559+
netdev_warn(ieee->dev, "No xmit handler.\n");
561560
goto success;
562561
}
563562

564563

565564
if (likely(ieee->raw_tx == 0)) {
566565
if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) {
567-
printk(KERN_WARNING "%s: skb too small (%d).\n",
568-
ieee->dev->name, skb->len);
566+
netdev_warn(ieee->dev, "skb too small (%d).\n",
567+
skb->len);
569568
goto success;
570569
}
571570

@@ -684,8 +683,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
684683
*/
685684
txb = ieee80211_alloc_txb(nr_frags, frag_size + ieee->tx_headroom, GFP_ATOMIC);
686685
if (unlikely(!txb)) {
687-
printk(KERN_WARNING "%s: Could not allocate TXB\n",
688-
ieee->dev->name);
686+
netdev_warn(ieee->dev, "Could not allocate TXB\n");
689687
goto failed;
690688
}
691689
txb->encrypted = encrypt;
@@ -778,15 +776,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
778776
}
779777
} else {
780778
if (unlikely(skb->len < sizeof(struct rtl_80211_hdr_3addr))) {
781-
printk(KERN_WARNING "%s: skb too small (%d).\n",
782-
ieee->dev->name, skb->len);
779+
netdev_warn(ieee->dev, "skb too small (%d).\n",
780+
skb->len);
783781
goto success;
784782
}
785783

786784
txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC);
787785
if (!txb) {
788-
printk(KERN_WARNING "%s: Could not allocate TXB\n",
789-
ieee->dev->name);
786+
netdev_warn(ieee->dev, "Could not allocate TXB\n");
790787
goto failed;
791788
}
792789

drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
356356
kfree(new_crypt);
357357
new_crypt = NULL;
358358

359-
printk(KERN_WARNING "%s: could not initialize WEP: "
360-
"load module ieee80211_crypt_wep\n",
361-
dev->name);
359+
netdev_warn(dev, "could not initialize WEP: "
360+
"load module ieee80211_crypt_wep\n");
362361
return -EOPNOTSUPP;
363362
}
364363
*crypt = new_crypt;

0 commit comments

Comments
 (0)