提交 d9ad7a98 编写于 作者: M Malcolm Priestley 提交者: Greg Kroah-Hartman

staging: vt6656: clean up s_nsInterruptUsbIoCompleteRead

Remove comments, white space and camel case

Camel Case changes
pDevice -> priv
ntStatus -> status
Signed-off-by: NMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 749627f2
...@@ -348,22 +348,12 @@ usb_fill_bulk_urb(pDevice->pInterruptURB, ...@@ -348,22 +348,12 @@ usb_fill_bulk_urb(pDevice->pInterruptURB,
static void s_nsInterruptUsbIoCompleteRead(struct urb *urb) static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
{ {
struct vnt_private *pDevice = (struct vnt_private *)urb->context; struct vnt_private *priv = (struct vnt_private *)urb->context;
int ntStatus; int status;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsInterruptUsbIoCompleteRead\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
// "---->s_nsInterruptUsbIoCompleteRead\n");
// The context given to IoSetCompletionRoutine is the receive buffer object
//
//
// We have a number of cases:
// 1) The USB read timed out and we received no data.
// 2) The USB read timed out and we received some data.
// 3) The USB read was successful and fully filled our irp buffer.
// 4) The irp was cancelled.
// 5) Some other failure from the USB device object.
//
switch (urb->status) { switch (urb->status) {
case 0: case 0:
case -ETIMEDOUT: case -ETIMEDOUT:
...@@ -371,50 +361,39 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb) ...@@ -371,50 +361,39 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
case -ECONNRESET: case -ECONNRESET:
case -ENOENT: case -ENOENT:
case -ESHUTDOWN: case -ESHUTDOWN:
pDevice->intBuf.bInUse = false; priv->intBuf.bInUse = false;
return; return;
default: default:
break; break;
} }
ntStatus = urb->status; status = urb->status;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_nsInterruptUsbIoCompleteRead Status %d\n", ntStatus); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"s_nsInterruptUsbIoCompleteRead Status %d\n", status);
// if we were not successful, we need to free the int buffer for future use right here if (status != STATUS_SUCCESS) {
// otherwise interrupt data handler will free int buffer after it handle it. priv->ulBulkInError++;
if (( ntStatus != STATUS_SUCCESS )) { priv->intBuf.bInUse = false;
pDevice->ulBulkInError++;
pDevice->intBuf.bInUse = false;
// if (ntStatus == USBD_STATUS_CRC) {
// pDevice->ulIntInContCRCError++;
// }
// if (ntStatus == STATUS_NOT_CONNECTED ) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
// { "IntUSBIoCompleteControl STATUS = %d\n", status);
// } } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"IntUSBIoCompleteControl STATUS = %d\n", ntStatus ); priv->ulIntInBytesRead += (unsigned long)urb->actual_length;
} else { priv->ulIntInContCRCError = 0;
pDevice->ulIntInBytesRead += (unsigned long) urb->actual_length; priv->bEventAvailable = true;
pDevice->ulIntInContCRCError = 0; INTnsProcessData(priv);
pDevice->bEventAvailable = true; }
INTnsProcessData(pDevice);
}
ntStatus = usb_submit_urb(pDevice->pInterruptURB, GFP_ATOMIC); status = usb_submit_urb(priv->pInterruptURB, GFP_ATOMIC);
if (ntStatus) { if (status) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"Submit int URB failed %d\n", ntStatus); "Submit int URB failed %d\n", status);
} else { } else {
pDevice->intBuf.bInUse = true; priv->intBuf.bInUse = true;
} }
// return;
// We return STATUS_MORE_PROCESSING_REQUIRED so that the completion
// routine (IofCompleteRequest) will stop working on the irp.
//
return ;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册