Skip to contentSkip to conversation

staging: wlan-ng: Remove unnecessary macro

PATCH In review Amitoj Kaur Chawla 2 participants 3 messages Feb 24, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: wlan-ng: Remove unnecessary macro

Remove unnecessary macro SUBMIT_URB by replacing it with a direct call to usb_submit_urb()

This change was made with the help of the following Coccinelle semantic patch:

//<smpl>
@@
identifier f,g;
@@
* #define f(...) g(...)
// </smpl>

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/wlan-ng/hfa384x_usb.c +3 -5
index 09b4b2c..602c3f3 100644
@@ -126,8 +126,6 @@
 #include <linux/usb.h>
 #include <linux/byteorder/generic.h>
 
-#define SUBMIT_URB(u, f)  usb_submit_urb(u, f)
-
 #include "p80211types.h"
 #include "p80211hdr.h"
 #include "p80211mgmt.h"
@@ -346,7 +344,7 @@ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags)
 	result = -ENOLINK;
 	if (!hw->wlandev->hwremoved &&
 	    !test_bit(WORK_RX_HALT, &hw->usb_flags)) {
-		result = SUBMIT_URB(&hw->rx_urb, memflags);
+		result = usb_submit_urb(&hw->rx_urb, memflags);
 
 		/* Check whether we need to reset the RX pipe */
 		if (result == -EPIPE) {
@@ -395,7 +393,7 @@ static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t memflags)
 	if (netif_running(netdev)) {
 		if (!hw->wlandev->hwremoved &&
 		    !test_bit(WORK_TX_HALT, &hw->usb_flags)) {
-			result = SUBMIT_URB(tx_urb, memflags);
+			result = usb_submit_urb(tx_urb, memflags);
 
 			/* Test whether we need to reset the TX pipe */
 			if (result == -EPIPE) {
@@ -2925,7 +2923,7 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw)
 		hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK;
 
 		/* Now submit the URB and update the CTLX's state */
-		result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC);
+		result = usb_submit_urb(&hw->ctlx_urb, GFP_ATOMIC);
 		if (result == 0) {
 			/* This CTLX is now running on the active queue */
 			head->state = CTLX_REQ_SUBMITTED;
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Amitoj Kaur Chawla

Remove unnecessary macro SUBMIT_URB by replacing it with a direct call to usb_submit_urb()

Nice catch.

julia

Quoted 66 lines

This change was made with the help of the following Coccinelle semantic patch:

//<smpl>
@@
identifier f,g;
@@
* #define f(...) g(...)
// </smpl>

---
 drivers/staging/wlan-ng/hfa384x_usb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/wlan-ng/hfa384x_usb.c +3 -6
index 09b4b2c..602c3f3 100644
@@ -126,8 +126,6 @@
 #include <linux/usb.h>
 #include <linux/byteorder/generic.h>
 
-#define SUBMIT_URB(u, f)  usb_submit_urb(u, f)
-
 #include "p80211types.h"
 #include "p80211hdr.h"
 #include "p80211mgmt.h"
@@ -346,7 +344,7 @@ static int submit_rx_urb(hfa384x_t *hw, gfp_t memflags)
 	result = -ENOLINK;
 	if (!hw->wlandev->hwremoved &&
 	    !test_bit(WORK_RX_HALT, &hw->usb_flags)) {
-		result = SUBMIT_URB(&hw->rx_urb, memflags);
+		result = usb_submit_urb(&hw->rx_urb, memflags);
 
 		/* Check whether we need to reset the RX pipe */
 		if (result == -EPIPE) {
@@ -395,7 +393,7 @@ static int submit_tx_urb(hfa384x_t *hw, struct urb *tx_urb, gfp_t memflags)
 	if (netif_running(netdev)) {
 		if (!hw->wlandev->hwremoved &&
 		    !test_bit(WORK_TX_HALT, &hw->usb_flags)) {
-			result = SUBMIT_URB(tx_urb, memflags);
+			result = usb_submit_urb(tx_urb, memflags);
 
 			/* Test whether we need to reset the TX pipe */
 			if (result == -EPIPE) {
@@ -2925,7 +2923,7 @@ static void hfa384x_usbctlxq_run(hfa384x_t *hw)
 		hw->ctlx_urb.transfer_flags |= USB_QUEUE_BULK;
 
 		/* Now submit the URB and update the CTLX's state */
-		result = SUBMIT_URB(&hw->ctlx_urb, GFP_ATOMIC);
+		result = usb_submit_urb(&hw->ctlx_urb, GFP_ATOMIC);
 		if (result == 0) {
 			/* This CTLX is now running on the active queue */
 			head->state = CTLX_REQ_SUBMITTED;
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160224162549.GA3992%40amitoj-Inspiron-3542.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 9 lines · Julia Lawall
Quoted 2 lines · Amitoj Kaur Chawla

Remove unnecessary macro SUBMIT_URB by replacing it with a direct call to usb_submit_urb()

Nice catch.

julia

Thanks! :)

Amitoj