Commit 94e74333 authored by Jade Bilkey's avatar Jade Bilkey Committed by Greg Kroah-Hartman

staging: bcm: Cleanup switch statement

Fixes checkpatch.pl warnings and errors:

ERROR: switch and case should be at the same indent
+	switch (status) {
[...]
+	    case STATUS_SUCCESS:
[...]
+		case -ENOENT :
[...]
+		case -EINPROGRESS:
[...]
+		case -EPIPE:
[...]
+	    case -ECONNRESET: //URB got unlinked.
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.
[...]
+	    case -ENODEV : //Device got removed
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.
[...]
+	    default:

ERROR: that open brace { should be on the previous line
+		if ( urb->actual_length )
+		{

ERROR: space prohibited after that open parenthesis '('
+		if ( urb->actual_length )

ERROR: space prohibited before that close parenthesis ')'
+		if ( urb->actual_length )

ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF)

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");
 				                       ^
ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF00)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] & 0xFF00)

WARNING: line over 80 characters
+					(psIntfAdapter->ulInterruptData[1] & 0xFF00) >> 8);

WARNING: space prohibited between function name and open parenthesis '('
+				atomic_set (&Adapter->uiMBupdate, TRUE);

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",
 				                       ^
+					atomic_read(&Adapter->CurrNumFreeTxDesc));

ERROR: that open brace { should be on the previous line
+			if(psIntfAdapter->ulInterruptData[1] >> 16)
+			{

ERROR: space required before the open parenthesis '('
+			if(psIntfAdapter->ulInterruptData[1] >> 16)

ERROR: spaces required around that '=' (ctx:VxE)
+				Adapter->CurrNumRecvDescs=
 				                         ^

WARNING: line over 80 characters
+					(psIntfAdapter->ulInterruptData[1]  >> 16);
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
 				                       ^

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
 				                                                               ^

ERROR: that open brace { should be on the previous line
+			if(Adapter->fw_download_done &&
+				!Adapter->downloadDDR &&
+				atomic_read(&Adapter->CurrNumFreeTxDesc))
+			{

ERROR: space required before the open parenthesis '('
+			if(Adapter->fw_download_done &&

ERROR: spaces required around that '+=' (ctx:WxV)
+				psIntfAdapter->psAdapter->downloadDDR +=1;
 				                                      ^

ERROR: that open brace { should be on the previous line
+			if(false == Adapter->waiting_to_fw_download_done)
+			{

ERROR: space required before the open parenthesis '('
+			if(false == Adapter->waiting_to_fw_download_done)

ERROR: that open brace { should be on the previous line
+			if(!atomic_read(&Adapter->TxPktAvail))
+			{

ERROR: space required before the open parenthesis '('
+			if(!atomic_read(&Adapter->TxPktAvail))

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");
 			                                                               ^

ERROR: space prohibited before that ':' (ctx:WxE)
+		case -ENOENT :
 		             ^

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");
 			                                                               ^

WARNING: space prohibited before semicolon
+			return ;

WARNING: line over 80 characters
+			//This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation.

ERROR: do not use C99 // comments
+			//This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation.

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");
 			                                                               ^

WARNING: space prohibited before semicolon
+			break ;

ERROR: do not use C99 // comments
+			//return;

WARNING: line over 80 characters
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");
 				                       ^

ERROR: space required after that ',' (ctx:VxV)
+				BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint  has got halted/stalled...need to clear this");
 				                                                               ^

WARNING: space prohibited before semicolon
+				Adapter->bEndPointHalted = TRUE ;

WARNING: space prohibited before semicolon
+				urb->status = STATUS_SUCCESS ;

ERROR: do not use C99 // comments
+	    case -ECONNRESET: //URB got unlinked.

WARNING: line over 80 characters
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.

ERROR: do not use C99 // comments
+	    case -ESHUTDOWN:		// hardware gone. this is the serious problem.

WARNING: line over 80 characters
+	    						//Occurs only when something happens with the host controller device

ERROR: code indent should use tabs where possible
+^I    ^I^I^I^I^I^I//Occurs only when something happens with the host controller device$

WARNING: please, no space before tabs
+^I    ^I^I^I^I^I^I//Occurs only when something happens with the host controller device$

ERROR: do not use C99 // comments
+	    						//Occurs only when something happens with the host controller device

ERROR: do not use C99 // comments
+	    case -ENODEV : //Device got removed

ERROR: space prohibited before that ':' (ctx:WxW)
+	    case -ENODEV : //Device got removed
 	                 ^

WARNING: line over 80 characters
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.

ERROR: do not use C99 // comments
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.

ERROR: space prohibited before that ':' (ctx:WxW)
+		case -EINVAL : //Some thing very bad happened with the URB. No description is available.
 		             ^

WARNING: line over 80 characters
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);

ERROR: code indent should use tabs where possible
+^I    ^IBCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);$

WARNING: please, no space before tabs
+^I    ^IBCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);$

ERROR: space required after that ',' (ctx:VxV)
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);
 	    	                       ^

ERROR: space required after that ',' (ctx:VxV)
+	    	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);
 	    	                                                               ^

WARNING: space prohibited before semicolon
+			urb->status = STATUS_SUCCESS ;

WARNING: space prohibited before semicolon
+			break ;

ERROR: do not use C99 // comments
+			//return;

ERROR: spaces required around that ':' (ctx:VxE)
+	    default:
 	           ^

WARNING: line over 80 characters
+			//This is required to check what is the defaults conditions when it occurs..

ERROR: do not use C99 // comments
+			//This is required to check what is the defaults conditions when it occurs..

WARNING: line over 80 characters
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);
 			                       ^

ERROR: space required after that ',' (ctx:VxV)
+			BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);
 			                                                           ^
Signed-off-by: default avatarJade Bilkey <herself@thefumon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 54585d5e
...@@ -29,85 +29,102 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/) ...@@ -29,85 +29,102 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/)
} }
switch (status) { switch (status) {
/* success */ /* success */
case STATUS_SUCCESS: case STATUS_SUCCESS:
if ( urb->actual_length ) if (urb->actual_length) {
{
if (psIntfAdapter->ulInterruptData[1] & 0xFF) {
if(psIntfAdapter->ulInterruptData[1] & 0xFF) BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
{ INTF_INIT, DBG_LVL_ALL,
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt"); "Got USIM interrupt");
} }
if(psIntfAdapter->ulInterruptData[1] & 0xFF00) if (psIntfAdapter->ulInterruptData[1] & 0xFF00) {
{
atomic_set(&Adapter->CurrNumFreeTxDesc, atomic_set(&Adapter->CurrNumFreeTxDesc,
(psIntfAdapter->ulInterruptData[1] & 0xFF00) >> 8); (psIntfAdapter->ulInterruptData[1] &
atomic_set (&Adapter->uiMBupdate, TRUE); 0xFF00) >> 8);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d", atomic_set(&Adapter->uiMBupdate, TRUE);
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
INTF_INIT, DBG_LVL_ALL,
"TX mailbox contains %d",
atomic_read(&Adapter->CurrNumFreeTxDesc)); atomic_read(&Adapter->CurrNumFreeTxDesc));
} }
if(psIntfAdapter->ulInterruptData[1] >> 16) if (psIntfAdapter->ulInterruptData[1] >> 16) {
{ Adapter->CurrNumRecvDescs =
Adapter->CurrNumRecvDescs=
(psIntfAdapter->ulInterruptData[1] >> 16); (psIntfAdapter->ulInterruptData[1] >> 16);
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d", BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
Adapter->CurrNumRecvDescs); INTF_INIT, DBG_LVL_ALL,
"RX mailbox contains %d",
Adapter->CurrNumRecvDescs);
InterfaceRx(psIntfAdapter); InterfaceRx(psIntfAdapter);
} }
if(Adapter->fw_download_done && if (Adapter->fw_download_done &&
!Adapter->downloadDDR && !Adapter->downloadDDR &&
atomic_read(&Adapter->CurrNumFreeTxDesc)) atomic_read(&Adapter->CurrNumFreeTxDesc)) {
{
psIntfAdapter->psAdapter->downloadDDR +=1; psIntfAdapter->psAdapter->downloadDDR += 1;
wake_up(&Adapter->tx_packet_wait_queue); wake_up(&Adapter->tx_packet_wait_queue);
} }
if(false == Adapter->waiting_to_fw_download_done) if (false == Adapter->waiting_to_fw_download_done) {
{
Adapter->waiting_to_fw_download_done = TRUE; Adapter->waiting_to_fw_download_done = TRUE;
wake_up(&Adapter->ioctl_fw_dnld_wait_queue); wake_up(&Adapter->ioctl_fw_dnld_wait_queue);
} }
if(!atomic_read(&Adapter->TxPktAvail)) if (!atomic_read(&Adapter->TxPktAvail)) {
{
atomic_set(&Adapter->TxPktAvail, 1); atomic_set(&Adapter->TxPktAvail, 1);
wake_up(&Adapter->tx_packet_wait_queue); wake_up(&Adapter->tx_packet_wait_queue);
} }
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB"); BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
DBG_LVL_ALL, "Firing interrupt in URB");
} }
break; break;
case -ENOENT : case -ENOENT:
{ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ...."); DBG_LVL_ALL, "URB has got disconnected....");
return ; return;
} case -EINPROGRESS:
case -EINPROGRESS: /*
{ * This situation may happened when URBunlink is used. for
//This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation. * detail check usb_unlink_urb documentation.
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on"); */
break ; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
//return; DBG_LVL_ALL,
} "Impossibe condition has occurred... something very bad is going on");
case -EPIPE: break;
{ /* return; */
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint has got halted/stalled...need to clear this"); case -EPIPE:
Adapter->bEndPointHalted = TRUE ; BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
wake_up(&Adapter->tx_packet_wait_queue); DBG_LVL_ALL,
urb->status = STATUS_SUCCESS ; "Interrupt IN endPoint has got halted/stalled...need to clear this");
return; Adapter->bEndPointHalted = TRUE;
} wake_up(&Adapter->tx_packet_wait_queue);
/* software-driven interface shutdown */ urb->status = STATUS_SUCCESS;
case -ECONNRESET: //URB got unlinked. return;
case -ESHUTDOWN: // hardware gone. this is the serious problem. /* software-driven interface shutdown */
//Occurs only when something happens with the host controller device case -ECONNRESET: /* URB got unlinked */
case -ENODEV : //Device got removed case -ESHUTDOWN: /* hardware gone. this is the serious problem */
case -EINVAL : //Some thing very bad happened with the URB. No description is available. /*
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status); * Occurs only when something happens with the
urb->status = STATUS_SUCCESS ; * host controller device
break ; */
//return; case -ENODEV: /* Device got removed */
default: case -EINVAL:
//This is required to check what is the defaults conditions when it occurs.. /*
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status); * Some thing very bad happened with the URB. No
* description is available.
*/
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
DBG_LVL_ALL, "interrupt urb error %d", status);
urb->status = STATUS_SUCCESS;
break;
/* return; */
default:
/*
* This is required to check what is the defaults conditions
* when it occurs..
*/
BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,
"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...",
status);
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment