Skip to contentSkip to conversation

staging: wlan-ng: Remove unnecessary code

PATCH New Amitoj Kaur Chawla 1 participant 4 messages Oct 31, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: wlan-ng: Remove unnecessary code

This patchset removes wrapper functions and unnecessary variable in wlan-ng.

Amitoj Kaur Chawla (3):
staging: wlan-ng: Remove wrapper function
staging: wlan-ng: hfa384x_usb: Remove wrapper function
staging: wlan-ng: prism2mib: Remove unnecessary variable

 drivers/staging/wlan-ng/hfa384x_usb.c | 34 +++-------------------------------
 drivers/staging/wlan-ng/prism2mgmt.h  |  1 -
 drivers/staging/wlan-ng/prism2mib.c   |  5 +----
 drivers/staging/wlan-ng/prism2sta.c   | 21 ---------------------
 4 files changed, 4 insertions(+), 57 deletions(-)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 staging: wlan-ng: hfa384x_usb: Remove wrapper function

Remove wrapper function that can be replaced by a single line of code.

As a result of the change, there is an unused variable which has also been removed in this patch.

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)
drivers/staging/wlan-ng/hfa384x_usb.c +1 -29
index e3c9860..7551ac2 100644
@@ -177,9 +177,6 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb);
 
 static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin);
 
-static void
-hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout);
-
 static void hfa384x_usbin_ctlx(hfa384x_t *hw, hfa384x_usbin_t *usbin,
 			       int urb_status);
 
@@ -3674,7 +3671,6 @@ static void hfa384x_usbin_info(wlandevice_t *wlandev, hfa384x_usbin_t *usbin)
 static void hfa384x_usbout_callback(struct urb *urb)
 {
 	wlandevice_t *wlandev = urb->context;
-	hfa384x_usbout_t *usbout = urb->transfer_buffer;
 
 #ifdef DEBUG_USB
 	dbprint_urb(urb);
@@ -3683,7 +3679,7 @@ static void hfa384x_usbout_callback(struct urb *urb)
 	if (wlandev && wlandev->netdev) {
 		switch (urb->status) {
 		case 0:
-			hfa384x_usbout_tx(wlandev, usbout);
+			prism2sta_ev_alloc(wlandev);
 			break;
 
 		case -EPIPE:
@@ -4038,30 +4034,6 @@ static int hfa384x_usbctlx_submit(hfa384x_t *hw, hfa384x_usbctlx_t *ctlx)
 }
 
 /*----------------------------------------------------------------
-* hfa384x_usbout_tx
-*
-* At this point we have finished a send of a frame.  Mark the URB
-* as available and call ev_alloc to notify higher layers we're
-* ready for more.
-*
-* Arguments:
-*	wlandev		wlan device
-*	usbout		ptr to the usb transfer buffer
-*
-* Returns:
-*	nothing
-*
-* Side effects:
-*
-* Call context:
-*	interrupt
-----------------------------------------------------------------*/
-static void hfa384x_usbout_tx(wlandevice_t *wlandev, hfa384x_usbout_t *usbout)
-{
-	prism2sta_ev_alloc(wlandev);
-}
-
-/*----------------------------------------------------------------
 * hfa384x_isgood_pdrcore
 *
 * Quick check of PDR codes.
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/3 staging: wlan-ng: prism2mib: Remove unnecessary variable

In reply to Amitoj Kaur Chawla

Drop unnecessary variable that can be replaced by a single line of code.

---
 drivers/staging/wlan-ng/prism2mib.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/staging/wlan-ng/prism2mib.c +1 -4
index b4a15ef..cdda07d 100644
@@ -660,7 +660,6 @@ static int prism2mib_fragmentationthreshold(struct mibrec *mib,
 					    struct p80211msg_dot11req_mibset *msg,
 					    void *data)
 {
-	int result;
 	u32 *uint32 = (u32 *) data;
 
 	if (!isget)
@@ -672,9 +671,7 @@ static int prism2mib_fragmentationthreshold(struct mibrec *mib,
 			return 0;
 		}
 
-	result = prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
-
-	return result;
+	return prism2mib_uint32(mib, isget, wlandev, hw, msg, data);
 }
 
 /*----------------------------------------------------------------
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 staging: wlan-ng: Remove wrapper function

In reply to Amitoj Kaur Chawla

Remove wrapper function that can be replaced by a single line of code.

---
 drivers/staging/wlan-ng/hfa384x_usb.c |  4 ++--
 drivers/staging/wlan-ng/prism2mgmt.h  |  1 -
 drivers/staging/wlan-ng/prism2sta.c   | 21 ---------------------
 3 files changed, 2 insertions(+), 24 deletions(-)
drivers/staging/wlan-ng/hfa384x_usb.c +2 -2
index 444ebed..e3c9860 100644
@@ -3504,7 +3504,7 @@ static void hfa384x_usbin_rx(wlandevice_t *wlandev, struct sk_buff *skb)
 		rxmeta->signal = usbin->rxfrm.desc.signal - hw->dbmadjust;
 		rxmeta->noise = usbin->rxfrm.desc.silence - hw->dbmadjust;
 
-		prism2sta_ev_rx(wlandev, skb);
+		p80211netdev_rx(wlandev, skb);
 
 		break;
 
@@ -3628,7 +3628,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
 	}
 
 	/* pass it back up */
-	prism2sta_ev_rx(wlandev, skb);
+	p80211netdev_rx(wlandev, skb);
 }
 
 /*----------------------------------------------------------------
drivers/staging/wlan-ng/prism2mgmt.h +0 -1
index 16f1239..7a9f424 100644
@@ -68,7 +68,6 @@ u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate);
 void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
 void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status);
 void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status);
-void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
 void prism2sta_ev_alloc(wlandevice_t *wlandev);
 
 int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp);
drivers/staging/wlan-ng/prism2sta.c +0 -21
index c57f48a..131223a 100644
@@ -1837,27 +1837,6 @@ void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status)
 }
 
 /*
- * prism2sta_ev_rx
- *
- * Handles the Rx event.
- *
- * Arguments:
- *	wlandev		wlan device structure
- *
- * Returns:
- *	nothing
- *
- * Side effects:
- *
- * Call context:
- *	interrupt
- */
-void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
-{
-	p80211netdev_rx(wlandev, skb);
-}
-
-/*
  * prism2sta_ev_alloc
  *
  * Handles the Alloc event.
Signature · 1 line
1.9.1