diff options
author | Vitaly Osipov <vitaly.osipov@gmail.com> | 2014-05-18 16:59:36 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-24 02:08:16 +0900 |
commit | 02d9b1eb4b21b9309efdf8c8aee023a59d3f76e0 (patch) | |
tree | e741eb880642e5dce3d7d885d0ce2be497fb7913 /drivers/staging/wlan-ng/p80211conv.c | |
parent | 79f9e634cc8312790d9674ea1faa998ea9cacfee (diff) | |
download | op-kernel-dev-02d9b1eb4b21b9309efdf8c8aee023a59d3f76e0.zip op-kernel-dev-02d9b1eb4b21b9309efdf8c8aee023a59d3f76e0.tar.gz |
staging: wlan-ng: use netdev_() instead of printk()
Replaced all uses of printk() in wlan-ng with netdev_err / _warn
where a netdev exists. If a few cases where a netdev does not yet
exist, dev_ or pr_ was used.
Checkpatch complains about lines over 80 chars or split string
constants - the messages are just too long, keeping it completely
happy would make the code less readable.
Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng/p80211conv.c')
-rw-r--r-- | drivers/staging/wlan-ng/p80211conv.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c index 3df753b..913676e 100644 --- a/drivers/staging/wlan-ng/p80211conv.c +++ b/drivers/staging/wlan-ng/p80211conv.c @@ -195,8 +195,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN); break; default: - printk(KERN_ERR - "Error: Converting eth to wlan in unknown mode.\n"); + netdev_err(wlandev->netdev, + "Error: Converting eth to wlan in unknown mode.\n"); return 1; break; } @@ -213,7 +213,7 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv, (wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK), p80211_wep->iv, p80211_wep->icv); if (foo) { - printk(KERN_WARNING + netdev_warn(wlandev->netdev, "Host en-WEP failed, dropping frame (%d).\n", foo); return 2; @@ -310,7 +310,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, } else { payload_offset = WLAN_HDR_A4_LEN; if (payload_length < WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN) { - printk(KERN_ERR "A4 frame too short!\n"); + netdev_err(netdev, "A4 frame too short!\n"); return 1; } payload_length -= (WLAN_HDR_A4_LEN - WLAN_HDR_A3_LEN); @@ -322,8 +322,8 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, if ((wlandev->hostwep & HOSTWEP_PRIVACYINVOKED) && WLAN_GET_FC_ISWEP(fc) && (wlandev->hostwep & HOSTWEP_DECRYPT)) { if (payload_length <= 8) { - printk(KERN_ERR "WEP frame too short (%u).\n", - skb->len); + netdev_err(netdev, + "WEP frame too short (%u).\n", skb->len); return 1; } foo = wep_decrypt(wlandev, skb->data + payload_offset + 4, @@ -367,7 +367,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, if (payload_length > (netdev->mtu + WLAN_ETHHDR_LEN)) { /* A bogus length ethfrm has been encap'd. */ /* Is someone trying an oflow attack? */ - printk(KERN_ERR "ENCAP frame too large (%d > %d)\n", + netdev_err(netdev, "ENCAP frame too large (%d > %d)\n", payload_length, netdev->mtu + WLAN_ETHHDR_LEN); return 1; } @@ -396,7 +396,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, if (payload_length > netdev->mtu) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ - printk(KERN_ERR "SNAP frame too large (%d > %d)\n", + netdev_err(netdev, "SNAP frame too large (%d > %d)\n", payload_length, netdev->mtu); return 1; } @@ -428,7 +428,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, > netdev->mtu) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ - printk(KERN_ERR "DIXII frame too large (%ld > %d)\n", + netdev_err(netdev, "DIXII frame too large (%ld > %d)\n", (long int)(payload_length - sizeof(struct wlan_llc) - sizeof(struct wlan_snap)), netdev->mtu); @@ -463,7 +463,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv, if (payload_length > netdev->mtu) { /* A bogus length ethfrm has been sent. */ /* Is someone trying an oflow attack? */ - printk(KERN_ERR "OTHER frame too large (%d > %d)\n", + netdev_err(netdev, "OTHER frame too large (%d > %d)\n", payload_length, netdev->mtu); return 1; } @@ -603,8 +603,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) /* If these already have metadata, we error out! */ if (P80211SKB_RXMETA(skb) != NULL) { - printk(KERN_ERR "%s: RXmeta already attached!\n", - wlandev->name); + netdev_err(wlandev->netdev, + "%s: RXmeta already attached!\n", wlandev->name); result = 0; goto exit; } @@ -613,8 +613,8 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb) rxmeta = kzalloc(sizeof(struct p80211_rxmeta), GFP_ATOMIC); if (rxmeta == NULL) { - printk(KERN_ERR "%s: Failed to allocate rxmeta.\n", - wlandev->name); + netdev_err(wlandev->netdev, + "%s: Failed to allocate rxmeta.\n", wlandev->name); result = 1; goto exit; } @@ -656,6 +656,7 @@ void p80211skb_free(struct wlandevice *wlandev, struct sk_buff *skb) if (meta && meta->rx) p80211skb_rxmeta_detach(skb); else - printk(KERN_ERR "Freeing an skb (%p) w/ no frmmeta.\n", skb); + netdev_err(wlandev->netdev, + "Freeing an skb (%p) w/ no frmmeta.\n", skb); dev_kfree_skb(skb); } |