Commit 173ffd09 authored by Tim Collier's avatar Tim Collier Committed by Greg Kroah-Hartman

staging: wlan-ng: convert P80211SKB_RXMETA to inline function in p80211conv

To avoid possible issues with repeated reference to the macro argument
as reported by checkpatch, macro P80211SKB_RXMETA is replaced with an
equivalent inline function. The function is named p80211skb_rxmeta to
follow the coding style guidelines; references to the macro are
updated to reference the new function.

This change depends on the similar change for P80211SKB_FRMMETA having
been applied.
Signed-off-by: default avatarTim Collier <osdevtc@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent df6835d1
......@@ -3417,7 +3417,7 @@ static void hfa384x_usbin_rx(struct wlandevice *wlandev, struct sk_buff *skb)
/* Attach the rxmeta, set some stuff */
p80211skb_rxmeta_attach(wlandev, skb);
rxmeta = P80211SKB_RXMETA(skb);
rxmeta = p80211skb_rxmeta(skb);
rxmeta->mactime = usbin->rxfrm.desc.time;
rxmeta->rxrate = usbin->rxfrm.desc.rate;
rxmeta->signal = usbin->rxfrm.desc.signal - hw->dbmadjust;
......
......@@ -497,7 +497,7 @@ int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
/* jkriegl: only process signal/noise if requested by iwspy */
if (wlandev->spy_number)
orinoco_spy_gather(wlandev, eth_hdr(skb)->h_source,
P80211SKB_RXMETA(skb));
p80211skb_rxmeta(skb));
/* Free the metadata */
p80211skb_rxmeta_detach(skb);
......@@ -605,7 +605,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
struct p80211_frmmeta *frmmeta;
/* If these already have metadata, we error out! */
if (P80211SKB_RXMETA(skb)) {
if (p80211skb_rxmeta(skb)) {
netdev_err(wlandev->netdev,
"%s: RXmeta already attached!\n", wlandev->name);
result = 0;
......
......@@ -63,10 +63,6 @@
#define P80211_FRMMETA_MAGIC 0x802110
#define P80211SKB_RXMETA(s) \
(p80211skb_frmmeta((s)) ? p80211skb_frmmeta((s))->rx : \
((struct p80211_rxmeta *)(NULL)))
struct p80211_rxmeta {
struct wlandevice *wlandev;
......@@ -99,6 +95,13 @@ static inline struct p80211_frmmeta *p80211skb_frmmeta(struct sk_buff *skb)
return frmmeta->magic == P80211_FRMMETA_MAGIC ? frmmeta : NULL;
}
static inline struct p80211_rxmeta *p80211skb_rxmeta(struct sk_buff *skb)
{
struct p80211_frmmeta *frmmeta = p80211skb_frmmeta(skb);
return frmmeta ? frmmeta->rx : NULL;
}
/*
* Frame capture header. (See doc/capturefrm.txt)
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment