Staging: winbond: Changed c99 comments to c89 comments
Subsystems (2)
PATCH 1/5 Staging: winbond: Changed c99 comments to c89 comments
checkpatch cleanup: Changed c99 comments to c89 comments
--- drivers/staging/winbond/wb35tx.c | 89 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 44 insertions(+), 45 deletions(-)
drivers/staging/winbond/wb35tx.c +44 -45
@@ -1,13 +1,13 @@ -//====================================== -// Copyright (c) 1996-2002 Winbond Electronic Corporation -// -// Module Name: -// Wb35Tx.c -// -// Abstract: -// Processing the Tx message and put into down layer -// -//====================================== +/* +* Copyright (c) 1996-2002 Winbond Electronic Corporation +* +* Module Name: +* Wb35Tx.c +* +* Abstract: +* Processing the Tx message and put into down layer +* +*/ #include <linux/usb.h> #include <linux/gfp.h>
@@ -33,20 +33,21 @@ static void Wb35Tx_complete(struct urb *struct wb35_mds *pMds = &adapter->Mds;printk ("wb35: tx complete\n" ); -// Variable setting +/* Variable setting */ pWb35Tx->EP4vm_state =VM_COMPLETED ; - pWb35Tx->EP4VM_status = pUrb->status;//Store the last result of Irp - pMds->TxOwner[ pWb35Tx->TxSendIndex ] =0 ;// Set the owner. Free the owner bit always. + pWb35Tx->EP4VM_status = pUrb->status;/* Store the last result of Irp */ +/* Set the owner. Free the owner bit always. */ + pMds->TxOwner[ pWb35Tx->TxSendIndex ] =0 ; pWb35Tx->TxSendIndex++; pWb35Tx->TxSendIndex %=MAX_USB_TX_BUFFER_NUMBER ; -if (pHwData->SurpriseRemove)// Let WbWlanHalt to handle surprise remove +if (pHwData->SurpriseRemove)/* Let WbWlanHalt to handle surprise remove */ goto error;if (pWb35Tx->tx_halt) goto error; -// The URB is completed, check the result +/* The URB is completed, check the result */ if (pWb35Tx->EP4VM_status !=0 ) {printk ("URB submission failed\n" ); pWb35Tx->EP4vm_state =VM_STOP ;
@@ -79,15 +80,15 @@ static void Wb35Tx(struct wbsoft_priv *aif (pWb35Tx->tx_halt) goto cleanup; -// Ownership checking +/* Ownership checking */ SendIndex = pWb35Tx->TxSendIndex; -if (!pMds->TxOwner[SendIndex])//No more data need to be sent, return immediately +/* No more data need to be sent, return immediately */ +if (!pMds->TxOwner[SendIndex]) goto cleanup; pTxBufferAddress = pWb35Tx->TxBuffer[SendIndex]; -// -// Issuing URB -// + +/* Issuing URB */ usb_fill_bulk_urb(pUrb, pHwData->udev, usb_sndbulkpipe(pHwData->udev, 4), pTxBufferAddress, pMds->TxBufferSize[ SendIndex ],
@@ -100,7 +101,7 @@ static void Wb35Tx(struct wbsoft_priv *a goto cleanup; } -// Check if driver needs issue Irp for EP2 +/* Check if driver needs issue Irp for EP2 */ pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex];if (pWb35Tx->TxFillCount >12 )Wb35Tx_EP2VM_start (adapter);
@@ -118,7 +119,7 @@ void Wb35Tx_start(struct wbsoft_priv *adstruct hw_data * pHwData = &adapter->sHwData;struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Allow only one thread to run into function +/* Allow only one thread to run into function */ if (atomic_inc_return (&pWb35Tx->TxFireCounter) =1 ) { pWb35Tx->EP4vm_state =VM_RUNNING ;Wb35Tx (adapter);
@@ -144,32 +145,32 @@ unsigned char Wb35Tx_initial(struct hw_dreturn true; } -//=========================== void Wb35Tx_stop (struct hw_data * pHwData) {struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Try to cancel the Trp of EP2 +/* Try to cancel the Trp of EP2 */ if (pWb35Tx->EP2vm_state =VM_RUNNING ) -usb_unlink_urb ( pWb35Tx->Tx2Urb );// Only use unlink, let Wb35Tx_destroy to free them +/* Only use unlink, let Wb35Tx_destroy to free them */ +usb_unlink_urb ( pWb35Tx->Tx2Urb );pr_debug ("EP2 Tx stop\n" ); -// Try to cancel the Irp of EP4 +/* Try to cancel the Irp of EP4 */ if (pWb35Tx->EP4vm_state =VM_RUNNING ) -usb_unlink_urb ( pWb35Tx->Tx4Urb );// Only use unlink, let Wb35Tx_destroy to free them +/* Only use unlink, let Wb35Tx_destroy to free them */ +usb_unlink_urb ( pWb35Tx->Tx4Urb );pr_debug ("EP4 Tx stop\n" ); } -//=========================== void Wb35Tx_destroy (struct hw_data * pHwData) {struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Wait for VM stop +/* Wait for VM stop */ do { -msleep (10 );// Delay for waiting function enter 940623.1.a +msleep (10 );/* Delay for waiting function enter 940623.1.a */ }while ( (pWb35Tx->EP2vm_state !=VM_STOP ) && (pWb35Tx->EP4vm_state !=VM_STOP ) ); -msleep (10 );// Delay for waiting function enter 940623.1.b +msleep (10 );/* Delay for waiting function enter 940623.1.b */ if (pWb35Tx->Tx4Urb)usb_free_urb ( pWb35Tx->Tx4Urb );
@@ -210,34 +211,34 @@ static void Wb35Tx_EP2VM_complete(structu16 InterruptInLength; -// Variable setting +/* Variable setting */ pWb35Tx->EP2vm_state =VM_COMPLETED ; pWb35Tx->EP2VM_status = pUrb->status; -// For Linux 2.4. Interrupt will always trigger -if (pHwData->SurpriseRemove)// Let WbWlanHalt to handle surprise remove +/* For Linux 2.4. Interrupt will always trigger */ +if (pHwData->SurpriseRemove)/* Let WbWlanHalt to handle surprise remove */ goto error;if (pWb35Tx->tx_halt) goto error; -//The Urb is completed, check the result +/* The Urb is completed, check the result */ if (pWb35Tx->EP2VM_status !=0 ) {printk ("EP2 IoCompleteRoutine return error\n" ); pWb35Tx->EP2vm_state=VM_STOP ; goto error; } -// Update the Tx result +/* Update the Tx result */ InterruptInLength = pUrb->actual_length; -// Modify for minimum memory access and DWORD alignment. -T02 .value =cpu_to_le32 (pltmp[0 ]) >>8 ;// [31:8] -> [24:0] - InterruptInLength -=1 ;// 20051221.1.c Modify the follow for more stable - InterruptInLength >>=2 ;// InterruptInLength/4 +/* Modify for minimum memory access and DWORD alignment. */ +T02 .value =cpu_to_le32 (pltmp[0 ]) >>8 ;/* [31:8] -> [24:0] */ + InterruptInLength -=1 ;/* 20051221.1.c Modify the follow for more stable */ + InterruptInLength >>=2 ;/* InterruptInLength/4 */ for (i =1 ; i <= InterruptInLength; i++) {T02 .value |= ((cpu_to_le32 (pltmp[i]) &0xff ) <<24 ); -TSTATUS .value =T02 .value;//20061009 anson's endian +TSTATUS .value =T02 .value;/* 20061009 anson's endian */ Mds_SendComplete ( adapter, &TSTATUS );T02 .value =cpu_to_le32 (pltmp[i]) >>8 ; }
@@ -262,9 +263,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_pif (pWb35Tx->tx_halt) goto error; -// -// Issuing URB -// +/* Issuing URB */ usb_fill_int_urb ( pUrb, pHwData->udev,usb_rcvintpipe (pHwData->udev,2 ), pltmp,MAX_INTERRUPT_LENGTH , Wb35Tx_EP2VM_complete, adapter,32 );
@@ -287,7 +286,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_prstruct hw_data * pHwData = &adapter->sHwData;struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Allow only one thread to run into function +/* Allow only one thread to run into function */ if (atomic_inc_return (&pWb35Tx->TxResultCount) =1 ) { pWb35Tx->EP2vm_state =VM_RUNNING ; Wb35Tx_EP2VM(adapter);Changed c99 comments to c89 comments
Quoted 3 lines · Harsh Kumar
checkpatch cleanup: Changed c99 comments to c89 comments
Signed-off-by Harsh Kumar <[email protected]>
Looks fine.
As you're updating these, feel free to read them and correct grammar and spelling mistakes. If the comment is not needed then go ahead and delete it.
You can do all that in the same patch I think and it's no problem.
drivers/staging/winbond/wb35tx.c static void Wb35Tx_EP2VM_complete(struct · line 241
Quoted 2 lines
drivers/staging/winbond/wb35tx.c +1
-1-TSTATUS .value =T02 .value;//20061009 anson's endian +TSTATUS .value =T02 .value;/* 20061009 anson's endian */
^^^^^^^^^^^^^^^^^^^^^^^^^
These type of comments come from people who don't use version control. :P Delete them.
drivers/staging/winbond/wb35tx.c static void Wb35Tx_EP2VM(struct wbsoft_p · line 266
Quoted 11 lines
drivers/staging/winbond/wb35tx.c +1
-3Mds_SendComplete ( adapter, &TSTATUS );T02 .value =cpu_to_le32 (pltmp[i]) >>8 ; }@@ -262,9 +263,7 @@ static void Wb35Tx_EP2VM(struct wbsoft_pif (pWb35Tx->tx_halt) goto error; -// -// Issuing URB -// +/* Issuing URB */
This is sort of an obvious comment. Also it's copied in several places. Feel free to delete it if it looks obvious to you, but if you're not sure then leave it in.
drivers/staging/winbond/wb35tx.c void Wb35Tx_EP2VM_start(struct wbsoft_pr · line 292
Quoted 12 lines
drivers/staging/winbond/wb35tx.c +1
-1usb_fill_int_urb ( pUrb, pHwData->udev,usb_rcvintpipe (pHwData->udev,2 ), pltmp,MAX_INTERRUPT_LENGTH , Wb35Tx_EP2VM_complete, adapter,32 );@@ -287,7 +286,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_prstruct hw_data * pHwData = &adapter->sHwData;struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Allow only one thread to run into function +/* Allow only one thread to run into function */ if (atomic_inc_return (&pWb35Tx->TxResultCount) =1 ) { pWb35Tx->EP2vm_state =VM_RUNNING ; Wb35Tx_EP2VM(adapter);Changed c99 comments to c89 comments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Somehow your patch got corrupted a bit but it still applies fine with fuzz.
regards,
dan carpenter
drivers/staging/winbond/wb35tx.c void Wb35Tx_EP2VM_start(struct wbsoft_pr · line 292
Quoted 9 lines · Harsh Kumar
drivers/staging/winbond/wb35tx.c +1
-1@@ -287,7 +286,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_prstruct hw_data * pHwData = &adapter->sHwData;struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Allow only one thread to run into function +/* Allow only one thread to run into function */ if (atomic_inc_return (&pWb35Tx->TxResultCount) =1 ) { pWb35Tx->EP2vm_state =VM_RUNNING ; Wb35Tx_EP2VM(adapter);Changed c99 comments to c89 comments
What's with that last line? It's not correct, did your email client get messed up?
odd...
greg k-h
Don't know why it happened. Either I messed it up while writing the mail or the email client misbehaved.
Quoted 17 lines · Greg KH
drivers/staging/winbond/wb35tx.c void Wb35Tx_EP2VM_start(struct wbsoft_pr · line 292
Quoted 9 lines · Harsh Kumar
drivers/staging/winbond/wb35tx.c +1
-1@@ -287,7 +286,7 @@ void Wb35Tx_EP2VM_start(struct wbsoft_prstruct hw_data * pHwData = &adapter->sHwData;struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; -// Allow only one thread to run into function +/* Allow only one thread to run into function */ if (atomic_inc_return (&pWb35Tx->TxResultCount) =1 ) { pWb35Tx->EP2vm_state =VM_RUNNING ; Wb35Tx_EP2VM(adapter);Changed c99 comments to c89 commentsWhat's with that last line? It's not correct, did your email client get messed up?
odd...
greg k-h