Commit 731047f9 authored by Andres More's avatar Andres More Committed by Greg Kroah-Hartman

staging: vt6656: removed macro to test bits

Removed custom macro used to test bits.
Signed-off-by: default avatarAndres More <more.andres@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 27264fb8
...@@ -887,11 +887,8 @@ typedef struct __device_info { ...@@ -887,11 +887,8 @@ typedef struct __device_info {
#define fMP_CONTROL_READS 0x00000400 #define fMP_CONTROL_READS 0x00000400
#define fMP_CONTROL_WRITES 0x00000800 #define fMP_CONTROL_WRITES 0x00000800
#define MP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F)) #define MP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))
#define MP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F)) #define MP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))
#define MP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)
#define MP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F)) #define MP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
#define MP_IS_READY(_M) (((_M)->Flags & \ #define MP_IS_READY(_M) (((_M)->Flags & \
...@@ -905,5 +902,3 @@ typedef struct __device_info { ...@@ -905,5 +902,3 @@ typedef struct __device_info {
BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF); BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF);
#endif #endif
...@@ -1522,7 +1522,8 @@ void RXvWorkItem(void *Context) ...@@ -1522,7 +1522,8 @@ void RXvWorkItem(void *Context)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
while ( MP_TEST_FLAG(pDevice, fMP_POST_READS) &&
while ((pDevice->Flags & fMP_POST_READS) &&
MP_IS_READY(pDevice) && MP_IS_READY(pDevice) &&
(pDevice->NumRecvFreeList != 0) ) { (pDevice->NumRecvFreeList != 0) ) {
pRCB = pDevice->FirstRecvFreeList; pRCB = pDevice->FirstRecvFreeList;
...@@ -1567,7 +1568,7 @@ RXvFreeRCB( ...@@ -1567,7 +1568,7 @@ RXvFreeRCB(
pDevice->NumRecvFreeList++; pDevice->NumRecvFreeList++;
if (MP_TEST_FLAG(pDevice, fMP_POST_READS) && MP_IS_READY(pDevice) && if ((pDevice->Flags & fMP_POST_READS) && MP_IS_READY(pDevice) &&
(pDevice->bIsRxWorkItemQueued == FALSE) ) { (pDevice->bIsRxWorkItemQueued == FALSE) ) {
pDevice->bIsRxWorkItemQueued = TRUE; pDevice->bIsRxWorkItemQueued = TRUE;
......
...@@ -118,13 +118,11 @@ int PIPEnsControlOutAsyn( ...@@ -118,13 +118,11 @@ int PIPEnsControlOutAsyn(
{ {
int ntStatus; int ntStatus;
if (MP_TEST_FLAG(pDevice, fMP_DISCONNECTED)) if (pDevice->Flags & fMP_DISCONNECTED)
return STATUS_FAILURE; return STATUS_FAILURE;
if (pDevice->Flags & fMP_CONTROL_WRITES)
if (MP_TEST_FLAG(pDevice, fMP_CONTROL_WRITES)) {
return STATUS_FAILURE; return STATUS_FAILURE;
}
if (in_interrupt()) { if (in_interrupt()) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"in_interrupt return ..byRequest %x\n", byRequest); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"in_interrupt return ..byRequest %x\n", byRequest);
...@@ -164,12 +162,11 @@ int PIPEnsControlOut( ...@@ -164,12 +162,11 @@ int PIPEnsControlOut(
int ntStatus = 0; int ntStatus = 0;
int ii; int ii;
if (MP_TEST_FLAG(pDevice, fMP_DISCONNECTED)) if (pDevice->Flags & fMP_DISCONNECTED)
return STATUS_FAILURE; return STATUS_FAILURE;
if (MP_TEST_FLAG(pDevice, fMP_CONTROL_WRITES)) { if (pDevice->Flags & fMP_CONTROL_WRITES)
return STATUS_FAILURE; return STATUS_FAILURE;
}
pDevice->sUsbCtlRequest.bRequestType = 0x40; pDevice->sUsbCtlRequest.bRequestType = 0x40;
pDevice->sUsbCtlRequest.bRequest = byRequest; pDevice->sUsbCtlRequest.bRequest = byRequest;
...@@ -193,12 +190,15 @@ int PIPEnsControlOut( ...@@ -193,12 +190,15 @@ int PIPEnsControlOut(
} }
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
for (ii = 0; ii <= USB_CTL_WAIT; ii ++) { for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
if (MP_TEST_FLAG(pDevice, fMP_CONTROL_WRITES))
if (pDevice->Flags & fMP_CONTROL_WRITES)
mdelay(1); mdelay(1);
else else
break; break;
if (ii >= USB_CTL_WAIT) { if (ii >= USB_CTL_WAIT) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control send request submission timeout \n"); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control send request submission timeout\n");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES); MP_CLEAR_FLAG(pDevice, fMP_CONTROL_WRITES);
return STATUS_FAILURE; return STATUS_FAILURE;
...@@ -221,12 +221,12 @@ int PIPEnsControlIn( ...@@ -221,12 +221,12 @@ int PIPEnsControlIn(
int ntStatus = 0; int ntStatus = 0;
int ii; int ii;
if (MP_TEST_FLAG(pDevice, fMP_DISCONNECTED)) if (pDevice->Flags & fMP_DISCONNECTED)
return STATUS_FAILURE; return STATUS_FAILURE;
if (MP_TEST_FLAG(pDevice, fMP_CONTROL_READS)) { if (pDevice->Flags & fMP_CONTROL_READS)
return STATUS_FAILURE; return STATUS_FAILURE;
}
pDevice->sUsbCtlRequest.bRequestType = 0xC0; pDevice->sUsbCtlRequest.bRequestType = 0xC0;
pDevice->sUsbCtlRequest.bRequest = byRequest; pDevice->sUsbCtlRequest.bRequest = byRequest;
pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue); pDevice->sUsbCtlRequest.wValue = cpu_to_le16p(&wValue);
...@@ -247,13 +247,15 @@ int PIPEnsControlIn( ...@@ -247,13 +247,15 @@ int PIPEnsControlIn(
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
for (ii = 0; ii <= USB_CTL_WAIT; ii ++) { for (ii = 0; ii <= USB_CTL_WAIT; ii ++) {
if (MP_TEST_FLAG(pDevice, fMP_CONTROL_READS))
if (pDevice->Flags & fMP_CONTROL_READS)
mdelay(1); mdelay(1);
else { else
break; break;
}
if (ii >= USB_CTL_WAIT) { if (ii >= USB_CTL_WAIT) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"control rcv request submission timeout \n"); DBG_PRT(MSG_LEVEL_DEBUG,
KERN_INFO "control rcv request submission timeout\n");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS); MP_CLEAR_FLAG(pDevice, fMP_CONTROL_READS);
return STATUS_FAILURE; return STATUS_FAILURE;
...@@ -492,7 +494,7 @@ int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB) ...@@ -492,7 +494,7 @@ int PIPEnsBulkInUsbRead(PSDevice pDevice, PRCB pRCB)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartBulkInUsbRead\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartBulkInUsbRead\n");
if (MP_TEST_FLAG(pDevice, fMP_DISCONNECTED)) if (pDevice->Flags & fMP_DISCONNECTED)
return STATUS_FAILURE; return STATUS_FAILURE;
pDevice->ulBulkInPosted++; pDevice->ulBulkInPosted++;
...@@ -643,7 +645,7 @@ PIPEnsSendBulkOut( ...@@ -643,7 +645,7 @@ PIPEnsSendBulkOut(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_nsSendBulkOut\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_nsSendBulkOut\n");
if(MP_IS_READY(pDevice) && MP_TEST_FLAG(pDevice, fMP_POST_WRITES)) { if (MP_IS_READY(pDevice) && (pDevice->Flags & fMP_POST_WRITES)) {
pUrb = pContext->pUrb; pUrb = pContext->pUrb;
pDevice->ulBulkOutPosted++; pDevice->ulBulkOutPosted++;
......
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