beeceem: Several checkpatch cleanups in InterfaceTx.c
cover beeceem: Several checkpatch cleanups in InterfaceTx.c
This patch series fixes some checkpatch issues in InterfaceTx.c which is part of the beeceem driver. The following errors/warnings have been fixed:
- prohibited spaces before a (semi)colon
- missing space before a variable assignment
- missing spaces between function arguments
- missing spaces before opening parentheses of if-conditionals
- unwanted opening braces of if-conditionals in an extra line
- spaces at the beginning of a line instead of tabs
- C99-style comments
However, over-80-chars warnings still remain.
This series applies no functional changes to the code whatsoever.
PATCH 1/4 beeceem: Fix several whitespace issues in InterfaceTx.c
This patch takes care of the following issues:
- missing spaces at variable assignments
- missing spaces between function arguments
- spaces at the beginning of a line where tabs should be
- prohibited spaces before a (semi)colon
--- drivers/staging/bcm/InterfaceTx.c | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-)
drivers/staging/bcm/InterfaceTx.c +32 -32
@@ -3,26 +3,26 @@/*this is transmit call-back(BULK OUT)*/ static void write_bulk_callback (struct urb *urb/*, struct pt_regs *regs*/ ) { -struct bcm_usb_tcb *pTcb= (struct bcm_usb_tcb *)urb->context; +struct bcm_usb_tcb *pTcb = (struct bcm_usb_tcb *)urb->context;struct bcm_interface_adapter *psIntfAdapter = pTcb->psIntfAdapter;struct bcm_link_request *pControlMsg = (struct bcm_link_request *)urb->transfer_buffer; -struct bcm_mini_adapter *psAdapter = psIntfAdapter->psAdapter ; -bool bpowerDownMsg = false ; +struct bcm_mini_adapter *psAdapter = psIntfAdapter->psAdapter; +bool bpowerDownMsg = false;struct bcm_mini_adapter *Adapter =GET_BCM_ADAPTER (gblpnetdev); -if (unlikely (netif_msg_tx_done (Adapter))) -pr_info (PFX "%s: transmit status %d\n" , Adapter->dev->name, urb->status); +if (unlikely (netif_msg_tx_done (Adapter))) +pr_info (PFX "%s: transmit status %d\n" , Adapter->dev->name, urb->status);if (urb->status !=STATUS_SUCCESS ) {if (urb->status == -EPIPE ) { - psIntfAdapter->psAdapter->bEndPointHalted = TRUE ; + psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue); }else { -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Tx URB has got cancelled. status :%d" , urb->status); +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Tx URB has got cancelled. status :%d" , urb->status); } }
@@ -38,12 +38,12 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) (pControlMsg->szData[1] == TARGET_CAN_GO_TO_IDLE_MODE))) { - bpowerDownMsg = TRUE ; + bpowerDownMsg = TRUE;//This covers the bus err while Idle Request msg sent down. if (urb->status !=STATUS_SUCCESS ) { - psAdapter->bPreparingForLowPowerMode = false ; -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Idle Mode Request msg failed to reach to Modem" ); + psAdapter->bPreparingForLowPowerMode = false; +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Idle Mode Request msg failed to reach to Modem" );//Signalling the cntrl pkt path in Ioctl wake_up (&psAdapter->lowpower_mode_wait_queue);StartInterruptUrb (psIntfAdapter);
@@ -54,9 +54,9 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) { psAdapter->IdleMode = TRUE;//since going in Idle mode completed hence making this var false; - psAdapter->bPreparingForLowPowerMode = false ; + psAdapter->bPreparingForLowPowerMode = false; -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in Idle Mode State..." ); +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in Idle Mode State..." );//Signalling the cntrl pkt path in Ioctl wake_up (&psAdapter->lowpower_mode_wait_queue); }
@@ -70,21 +70,21 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)//This covers the bus err while shutdown Request msg sent down. if (urb->status !=STATUS_SUCCESS ) { - psAdapter->bPreparingForLowPowerMode = false ; -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Shutdown Request Msg failed to reach to Modem" ); + psAdapter->bPreparingForLowPowerMode = false; +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Shutdown Request Msg failed to reach to Modem" );//Signalling the cntrl pkt path in Ioctl wake_up (&psAdapter->lowpower_mode_wait_queue);StartInterruptUrb (psIntfAdapter); goto err_exit; } - bpowerDownMsg = TRUE ; + bpowerDownMsg = TRUE;if (psAdapter->bDoSuspend == false) { psAdapter->bShutStatus = TRUE;//since going in shutdown mode completed hence making this var false; - psAdapter->bPreparingForLowPowerMode = false ; -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in shutdown Mode State..." ); + psAdapter->bPreparingForLowPowerMode = false; +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in shutdown Mode State..." );//Signalling the cntrl pkt path in Ioctl wake_up (&psAdapter->lowpower_mode_wait_queue); }
@@ -93,7 +93,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)if (psAdapter->bDoSuspend && bpowerDownMsg) {//issuing bus suspend request -BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Issuing the Bus suspend request to USB stack" ); +BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Issuing the Bus suspend request to USB stack" ); psIntfAdapter->bPreparingForBusSuspend = TRUE;schedule_work (&psIntfAdapter->usbSuspendWork);
@@ -101,9 +101,9 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } -err_exit : +err_exit:usb_free_coherent (urb->dev, urb->transfer_buffer_length, - urb->transfer_buffer, urb->transfer_dma); + urb->transfer_buffer, urb->transfer_dma); }
@@ -113,13 +113,13 @@ static struct bcm_usb_tcb *GetBulkOutTcb(struct bcm_interface_adapter *psIntfAdaUINT index =0 ;if ((atomic_read (&psIntfAdapter->uNumTcbUsed) <MAXIMUM_USB_TCB ) && - (psIntfAdapter->psAdapter->StopAllXaction ==false)) + (psIntfAdapter->psAdapter->StopAllXaction == false)) { index =atomic_read (&psIntfAdapter->uCurrTcb); pTcb = &psIntfAdapter->asUsbTcb[index]; pTcb->bUsed = TRUE; - pTcb->psIntfAdapter= psIntfAdapter; -BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Got Tx desc %d used %d" , + pTcb->psIntfAdapter = psIntfAdapter; +BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Got Tx desc %d used %d" , index,atomic_read (&psIntfAdapter->uNumTcbUsed)); index = (index +1 ) %MAXIMUM_USB_TCB ;atomic_set (&psIntfAdapter->uCurrTcb, index);
@@ -135,21 +135,21 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uint retval =0 ; urb->transfer_buffer =usb_alloc_coherent (psIntfAdapter->udev, len, -GFP_ATOMIC , &urb->transfer_dma); +GFP_ATOMIC , &urb->transfer_dma);if (!urb->transfer_buffer) { -BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"Error allocating memory\n" ); +BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"Error allocating memory\n" );return -ENOMEM ; }memcpy (urb->transfer_buffer, data, len); urb->transfer_buffer_length = len; -BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Sending Bulk out packet\n" ); +BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Sending Bulk out packet\n" );//For T3B,INT OUT end point will be used as bulk out end point if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) {usb_fill_int_urb (urb, psIntfAdapter->udev, - psIntfAdapter->sBulkOut.bulk_out_pipe, + psIntfAdapter->sBulkOut.bulk_out_pipe, urb->transfer_buffer, len, write_bulk_callback, pTcb, psIntfAdapter->sBulkOut.int_out_interval); }
@@ -169,10 +169,10 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_u retval =usb_submit_urb (urb,GFP_ATOMIC );if (retval) { -BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"failed submitting write urb, error %d" , retval); +BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"failed submitting write urb, error %d" , retval);if (retval == -EPIPE ) { - psIntfAdapter->psAdapter->bEndPointHalted = TRUE ; + psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue); } }
@@ -182,13 +182,13 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uint InterfaceTransmitPacket (PVOID arg,PVOID data,UINT len) { -struct bcm_usb_tcb *pTcb=NULL ; +struct bcm_usb_tcb *pTcb =NULL ;struct bcm_interface_adapter *psIntfAdapter = arg; - pTcb=GetBulkOutTcb (psIntfAdapter); + pTcb =GetBulkOutTcb (psIntfAdapter);if (pTcb ==NULL ) { -BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"No URB to transmit packet, dropping packet" ); +BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"No URB to transmit packet, dropping packet" );return -EFAULT ; }return TransmitTcb (psIntfAdapter, pTcb, data, len);
Signature · 1 line
1.7.10.4
PATCH 2/4 beeceem: Add spaces before opening parentheses in if-conditionals in InterfaceTx.c
In reply to Ralph MueckThis patch adds spaces before the opening parentheses of if-conditionals to comply with offical code styling guidelines.
--- drivers/staging/bcm/InterfaceTx.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/staging/bcm/InterfaceTx.c +15 -15
@@ -13,9 +13,9 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)if (unlikely (netif_msg_tx_done (Adapter)))pr_info (PFX "%s: transmit status %d\n" , Adapter->dev->name, urb->status); -if (urb->status !=STATUS_SUCCESS ) +if (urb->status !=STATUS_SUCCESS ) { -if (urb->status == -EPIPE ) +if (urb->status == -EPIPE ) { psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue);
@@ -31,16 +31,16 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) -if (TRUE == psAdapter->bPreparingForLowPowerMode) +if (TRUE == psAdapter->bPreparingForLowPowerMode) { -if (((pControlMsg->szData[0 ] ==GO_TO_IDLE_MODE_PAYLOAD ) && +if (((pControlMsg->szData[0 ] ==GO_TO_IDLE_MODE_PAYLOAD ) && (pControlMsg->szData[1 ] ==TARGET_CAN_GO_TO_IDLE_MODE ))) { bpowerDownMsg = TRUE;//This covers the bus err while Idle Request msg sent down. -if (urb->status !=STATUS_SUCCESS ) +if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Idle Mode Request msg failed to reach to Modem" );
@@ -50,7 +50,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) goto err_exit; } -if (psAdapter->bDoSuspend == false) +if (psAdapter->bDoSuspend == false) { psAdapter->IdleMode = TRUE;//since going in Idle mode completed hence making this var false;
@@ -62,13 +62,13 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } } -else if ((pControlMsg->Leader.Status ==LINK_UP_CONTROL_REQ ) && +else if ((pControlMsg->Leader.Status ==LINK_UP_CONTROL_REQ ) && (pControlMsg->szData[0 ] ==LINK_UP_ACK ) && (pControlMsg->szData[1 ] ==LINK_SHUTDOWN_REQ_FROM_FIRMWARE ) && (pControlMsg->szData[2 ] ==SHUTDOWN_ACK_FROM_DRIVER )) {//This covers the bus err while shutdown Request msg sent down. -if (urb->status !=STATUS_SUCCESS ) +if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Shutdown Request Msg failed to reach to Modem" );
@@ -79,7 +79,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } bpowerDownMsg = TRUE; -if (psAdapter->bDoSuspend == false) +if (psAdapter->bDoSuspend == false) { psAdapter->bShutStatus = TRUE;//since going in shutdown mode completed hence making this var false;
@@ -90,7 +90,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } } -if (psAdapter->bDoSuspend && bpowerDownMsg) +if (psAdapter->bDoSuspend && bpowerDownMsg) {//issuing bus suspend request BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Issuing the Bus suspend request to USB stack" );
@@ -112,7 +112,7 @@ static struct bcm_usb_tcb *GetBulkOutTcb(struct bcm_interface_adapter *psIntfAdastruct bcm_usb_tcb *pTcb =NULL ;UINT index =0 ; -if ((atomic_read (&psIntfAdapter->uNumTcbUsed) <MAXIMUM_USB_TCB ) && +if ((atomic_read (&psIntfAdapter->uNumTcbUsed) <MAXIMUM_USB_TCB ) && (psIntfAdapter->psAdapter->StopAllXaction == false)) { index =atomic_read (&psIntfAdapter->uCurrTcb);
@@ -146,7 +146,7 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uBCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Sending Bulk out packet\n" );//For T3B,INT OUT end point will be used as bulk out end point -if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) +if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) { usb_fill_int_urb(urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe,
@@ -161,7 +161,7 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_u } urb->transfer_flags |=URB_NO_TRANSFER_DMA_MAP ;/* For DMA transfer */ -if (false == psIntfAdapter->psAdapter->device_removed && +if (false == psIntfAdapter->psAdapter->device_removed && false == psIntfAdapter->psAdapter->bEndPointHalted && false == psIntfAdapter->bSuspended && false == psIntfAdapter->bPreparingForBusSuspend)
@@ -170,7 +170,7 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uif (retval) {BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"failed submitting write urb, error %d" , retval); -if (retval == -EPIPE ) +if (retval == -EPIPE ) { psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue);
@@ -186,7 +186,7 @@ int InterfaceTransmitPacket(PVOID arg, PVOID data, UINT len)struct bcm_interface_adapter *psIntfAdapter = arg; pTcb =GetBulkOutTcb (psIntfAdapter); -if (pTcb ==NULL ) +if (pTcb ==NULL ) {BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"No URB to transmit packet, dropping packet" );return -EFAULT ;
Signature · 1 line
1.7.10.4
PATCH 3/4 beeceem: Fix position of braces in conditional statements in InterfaceTx.c
In reply to Ralph MueckThis corrects the position of (opening) braces in if-conditionals to make checkpatch shut up.
--- drivers/staging/bcm/InterfaceTx.c | 63 ++++++++++++------------------------- 1 file changed, 20 insertions(+), 43 deletions(-)
drivers/staging/bcm/InterfaceTx.c +20 -43
@@ -13,15 +13,11 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)if (unlikely (netif_msg_tx_done (Adapter)))pr_info (PFX "%s: transmit status %d\n" , Adapter->dev->name, urb->status); -if (urb->status !=STATUS_SUCCESS ) - { -if (urb->status == -EPIPE ) - { +if (urb->status !=STATUS_SUCCESS ) { +if (urb->status == -EPIPE ) { psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue); - } -else - { + }else {BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Tx URB has got cancelled. status :%d" , urb->status); } }
@@ -31,17 +27,13 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) -if (TRUE == psAdapter->bPreparingForLowPowerMode) - { +if (TRUE == psAdapter->bPreparingForLowPowerMode) {if (((pControlMsg->szData[0 ] ==GO_TO_IDLE_MODE_PAYLOAD ) && - (pControlMsg->szData[1 ] ==TARGET_CAN_GO_TO_IDLE_MODE ))) - - { + (pControlMsg->szData[1 ] ==TARGET_CAN_GO_TO_IDLE_MODE ))) { bpowerDownMsg = TRUE;//This covers the bus err while Idle Request msg sent down. -if (urb->status !=STATUS_SUCCESS ) - { +if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Idle Mode Request msg failed to reach to Modem" );//Signalling the cntrl pkt path in Ioctl
@@ -50,8 +42,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) goto err_exit; } -if (psAdapter->bDoSuspend == false) - { +if (psAdapter->bDoSuspend == false) { psAdapter->IdleMode = TRUE;//since going in Idle mode completed hence making this var false; psAdapter->bPreparingForLowPowerMode = false;
@@ -61,15 +52,12 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)wake_up (&psAdapter->lowpower_mode_wait_queue); } - } -else if ((pControlMsg->Leader.Status ==LINK_UP_CONTROL_REQ ) && + }else if ((pControlMsg->Leader.Status ==LINK_UP_CONTROL_REQ ) && (pControlMsg->szData[0 ] ==LINK_UP_ACK ) && (pControlMsg->szData[1 ] ==LINK_SHUTDOWN_REQ_FROM_FIRMWARE ) && - (pControlMsg->szData[2 ] ==SHUTDOWN_ACK_FROM_DRIVER )) - { + (pControlMsg->szData[2 ] ==SHUTDOWN_ACK_FROM_DRIVER )) {//This covers the bus err while shutdown Request msg sent down. -if (urb->status !=STATUS_SUCCESS ) - { +if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Shutdown Request Msg failed to reach to Modem" );//Signalling the cntrl pkt path in Ioctl
@@ -79,8 +67,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } bpowerDownMsg = TRUE; -if (psAdapter->bDoSuspend == false) - { +if (psAdapter->bDoSuspend == false) { psAdapter->bShutStatus = TRUE;//since going in shutdown mode completed hence making this var false; psAdapter->bPreparingForLowPowerMode = false;
@@ -90,8 +77,7 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) } } -if (psAdapter->bDoSuspend && bpowerDownMsg) - { +if (psAdapter->bDoSuspend && bpowerDownMsg) {//issuing bus suspend request BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Issuing the Bus suspend request to USB stack" ); psIntfAdapter->bPreparingForBusSuspend = TRUE;
@@ -113,8 +99,7 @@ static struct bcm_usb_tcb *GetBulkOutTcb(struct bcm_interface_adapter *psIntfAdaUINT index =0 ;if ((atomic_read (&psIntfAdapter->uNumTcbUsed) <MAXIMUM_USB_TCB ) && - (psIntfAdapter->psAdapter->StopAllXaction == false)) - { + (psIntfAdapter->psAdapter->StopAllXaction == false)) { index =atomic_read (&psIntfAdapter->uCurrTcb); pTcb = &psIntfAdapter->asUsbTcb[index]; pTcb->bUsed = TRUE;
@@ -136,8 +121,7 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_u urb->transfer_buffer =usb_alloc_coherent (psIntfAdapter->udev, len,GFP_ATOMIC , &urb->transfer_dma); -if (!urb->transfer_buffer) - { +if (!urb->transfer_buffer) {BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"Error allocating memory\n" );return -ENOMEM ; }
@@ -146,15 +130,12 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uBCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Sending Bulk out packet\n" );//For T3B,INT OUT end point will be used as bulk out end point -if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) - { +if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) {usb_fill_int_urb (urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe, urb->transfer_buffer, len, write_bulk_callback, pTcb, psIntfAdapter->sBulkOut.int_out_interval); - } -else - { + }else {usb_fill_bulk_urb (urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe, urb->transfer_buffer, len, write_bulk_callback, pTcb);
@@ -164,14 +145,11 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_uif (false == psIntfAdapter->psAdapter->device_removed && false == psIntfAdapter->psAdapter->bEndPointHalted && false == psIntfAdapter->bSuspended && - false == psIntfAdapter->bPreparingForBusSuspend) - { + false == psIntfAdapter->bPreparingForBusSuspend) { retval =usb_submit_urb (urb,GFP_ATOMIC ); -if (retval) - { +if (retval) {BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"failed submitting write urb, error %d" , retval); -if (retval == -EPIPE ) - { +if (retval == -EPIPE ) { psIntfAdapter->psAdapter->bEndPointHalted = TRUE;wake_up (&psIntfAdapter->psAdapter->tx_packet_wait_queue); }
@@ -186,8 +164,7 @@ int InterfaceTransmitPacket(PVOID arg, PVOID data, UINT len)struct bcm_interface_adapter *psIntfAdapter = arg; pTcb =GetBulkOutTcb (psIntfAdapter); -if (pTcb ==NULL ) - { +if (pTcb ==NULL ) {BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_PRINTK ,0 ,0 ,"No URB to transmit packet, dropping packet" );return -EFAULT ; }
Signature · 1 line
1.7.10.4
PATCH 4/4 beeceem: Replace C99-style comments with C89 pendants in InterfaceTx.c
In reply to Ralph MueckCheckpatch complains about the use of //-comments, thus they are replaced by C89-style comments.
--- drivers/staging/bcm/InterfaceTx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/bcm/InterfaceTx.c +10 -10
@@ -32,11 +32,11 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)if (((pControlMsg->szData[0 ] ==GO_TO_IDLE_MODE_PAYLOAD ) && (pControlMsg->szData[1 ] ==TARGET_CAN_GO_TO_IDLE_MODE ))) { bpowerDownMsg = TRUE; -//This covers the bus err while Idle Request msg sent down. +/* This covers the bus err while Idle Request msg sent down. */ if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Idle Mode Request msg failed to reach to Modem" ); -//Signalling the cntrl pkt path in Ioctl +/* Signalling the cntrl pkt path in Ioctl */ wake_up (&psAdapter->lowpower_mode_wait_queue);StartInterruptUrb (psIntfAdapter); goto err_exit;
@@ -44,11 +44,11 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)if (psAdapter->bDoSuspend == false) { psAdapter->IdleMode = TRUE; -//since going in Idle mode completed hence making this var false; +/* since going in Idle mode completed hence making this var false */ psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in Idle Mode State..." ); -//Signalling the cntrl pkt path in Ioctl +/* Signalling the cntrl pkt path in Ioctl*/ wake_up (&psAdapter->lowpower_mode_wait_queue); }
@@ -56,11 +56,11 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) (pControlMsg->szData[0] == LINK_UP_ACK) && (pControlMsg->szData[1] == LINK_SHUTDOWN_REQ_FROM_FIRMWARE) && (pControlMsg->szData[2] == SHUTDOWN_ACK_FROM_DRIVER)) { -//This covers the bus err while shutdown Request msg sent down. +/* This covers the bus err while shutdown Request msg sent down. */ if (urb->status !=STATUS_SUCCESS ) { psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Shutdown Request Msg failed to reach to Modem" ); -//Signalling the cntrl pkt path in Ioctl +/* Signalling the cntrl pkt path in Ioctl */ wake_up (&psAdapter->lowpower_mode_wait_queue);StartInterruptUrb (psIntfAdapter); goto err_exit;
@@ -69,16 +69,16 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/) bpowerDownMsg = TRUE;if (psAdapter->bDoSuspend == false) { psAdapter->bShutStatus = TRUE; -//since going in shutdown mode completed hence making this var false; +/* since going in shutdown mode completed hence making this var false */ psAdapter->bPreparingForLowPowerMode = false;BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Host Entered in shutdown Mode State..." ); -//Signalling the cntrl pkt path in Ioctl +/* Signalling the cntrl pkt path in Ioctl */ wake_up (&psAdapter->lowpower_mode_wait_queue); } }if (psAdapter->bDoSuspend && bpowerDownMsg) { -//issuing bus suspend request +/* issuing bus suspend request */ BCM_DEBUG_PRINT (Adapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Issuing the Bus suspend request to USB stack" ); psIntfAdapter->bPreparingForBusSuspend = TRUE;schedule_work (&psIntfAdapter->usbSuspendWork);
@@ -129,7 +129,7 @@ static int TransmitTcb(struct bcm_interface_adapter *psIntfAdapter, struct bcm_u urb->transfer_buffer_length = len;BCM_DEBUG_PRINT (psIntfAdapter->psAdapter,DBG_TYPE_TX ,NEXT_SEND ,DBG_LVL_ALL ,"Sending Bulk out packet\n" ); -//For T3B,INT OUT end point will be used as bulk out end point +/* For T3B,INT OUT end point will be used as bulk out end point */ if ((psIntfAdapter->psAdapter->chip_id ==T3B ) && (psIntfAdapter->bHighSpeedDevice == TRUE)) { usb_fill_int_urb(urb, psIntfAdapter->udev, psIntfAdapter->sBulkOut.bulk_out_pipe,
Signature · 1 line
1.7.10.4