Commit 6a569336 authored by Sam Muhammed's avatar Sam Muhammed Committed by Greg Kroah-Hartman
Browse files

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: default avatarSam Muhammed <jane.pnx9@gmail.com>
Link: https://lore.kernel.org/r/02fe0666cb737a3b0581081c9e7c179bfb820cac.1585233434.git.jane.pnx9@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ea7a10ea
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -68,8 +68,7 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
				 sizeof(struct ieee80211_network),
				 GFP_KERNEL);
	if (!ieee->networks) {
		printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
		       ieee->dev->name);
		netdev_warn(ieee->dev, "Out of memory allocating beacons\n");
		return -ENOMEM;
	}

+7 −10
Original line number Diff line number Diff line
@@ -556,16 +556,15 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
	 */
	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)))) {
		printk(KERN_WARNING "%s: No xmit handler.\n",
		       ieee->dev->name);
		netdev_warn(ieee->dev, "No xmit handler.\n");
		goto success;
	}


	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;
		}

@@ -684,8 +683,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
		 */
		txb = ieee80211_alloc_txb(nr_frags, frag_size + ieee->tx_headroom, 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;
@@ -778,15 +776,14 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
		}
	} else {
		if (unlikely(skb->len < sizeof(struct rtl_80211_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;
		}

+2 −3
Original line number Diff line number Diff line
@@ -356,9 +356,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
			kfree(new_crypt);
			new_crypt = NULL;

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