[PATCH 2/2] staging: wlan-ng: convert P80211SKB_RXMETA to inline function in p80211conv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: Tim Collier <osdevtc@xxxxxxxxx>
---
 drivers/staging/wlan-ng/hfa384x_usb.c |  2 +-
 drivers/staging/wlan-ng/p80211conv.c  |  4 ++--
 drivers/staging/wlan-ng/p80211conv.h  | 11 +++++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index c1e88b8b751f..33e97ffbb436 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -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;
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 646e9c205c52..91debcf20646 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -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;
diff --git a/drivers/staging/wlan-ng/p80211conv.h b/drivers/staging/wlan-ng/p80211conv.h
index c3456b7eff04..827002ca9930 100644
--- a/drivers/staging/wlan-ng/p80211conv.h
+++ b/drivers/staging/wlan-ng/p80211conv.h
@@ -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)
  */
-- 
2.11.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux