Author: tfaber
Date: Sat Jul 5 16:32:43 2014
New Revision: 63687
URL:
http://svn.reactos.org/svn/reactos?rev=63687&view=rev
Log:
[USBEHCI]
- Fix a type-limits warning
- Remove unnecessary casts and asserts
- Use NULL for pointer comparison
- Fix IN vs OUT annotation
Modified:
trunk/reactos/drivers/usb/usbehci/interfaces.h
trunk/reactos/drivers/usb/usbehci/usb_queue.cpp
trunk/reactos/drivers/usb/usbehci/usb_request.cpp
Modified: trunk/reactos/drivers/usb/usbehci/interfaces.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/interf…
==============================================================================
--- trunk/reactos/drivers/usb/usbehci/interfaces.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbehci/interfaces.h [iso-8859-1] Sat Jul 5 16:32:43 2014
@@ -23,7 +23,7 @@
IN struct _EHCI_USBCMD_CONTENT *UsbCmd) PURE; \
\
STDMETHOD_(VOID, GetCommandRegister)( THIS_ \
- IN struct _EHCI_USBCMD_CONTENT *UsbCmd) PURE;
+ OUT struct _EHCI_USBCMD_CONTENT *UsbCmd) PURE;
#define IMP_IUSBEHCIHARDWARE \
STDMETHODIMP_(VOID) SetAsyncListRegister( \
@@ -39,7 +39,7 @@
STDMETHODIMP_(VOID) SetCommandRegister( \
IN struct _EHCI_USBCMD_CONTENT *UsbCmd); \
STDMETHODIMP_(VOID) GetCommandRegister( \
- IN struct _EHCI_USBCMD_CONTENT *UsbCmd);
+ OUT struct _EHCI_USBCMD_CONTENT *UsbCmd);
DECLARE_INTERFACE_(IEHCIHardwareDevice, IUSBHardwareDevice)
{
Modified: trunk/reactos/drivers/usb/usbehci/usb_queue.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usb_qu…
==============================================================================
--- trunk/reactos/drivers/usb/usbehci/usb_queue.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbehci/usb_queue.cpp [iso-8859-1] Sat Jul 5 16:32:43 2014
@@ -376,6 +376,7 @@
{
UCHAR IntervalIndex;
+ ASSERT(Interval != 0);
if (Interval == 1)
IntervalIndex = 1;
else if (Interval == 2)
@@ -392,11 +393,10 @@
IntervalIndex = 7;
else if (Interval <= 128)
IntervalIndex = 8;
- else if (Interval <= 256)
+ else
IntervalIndex = 9;
- else
- IntervalIndex = 10;
-
+
+ ASSERT(IntervalIndex < EHCI_INTERRUPT_ENTRIES_COUNT);
return IntervalIndex;
}
@@ -746,8 +746,7 @@
//
// get queue head structure
//
- QueueHead = (PQUEUE_HEAD)CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
- ASSERT(QueueHead);
+ QueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
//
// sanity check
@@ -822,8 +821,7 @@
//
// get queue head structure
//
- QueueHead = (PQUEUE_HEAD)CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
- ASSERT(QueueHead);
+ QueueHead = CONTAINING_RECORD(Entry, QUEUE_HEAD, LinkedQueueHeads);
//
// sanity check
Modified: trunk/reactos/drivers/usb/usbehci/usb_request.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbehci/usb_re…
==============================================================================
--- trunk/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbehci/usb_request.cpp [iso-8859-1] Sat Jul 5 16:32:43
2014
@@ -894,7 +894,7 @@
//
QueueHead->EndPointCharacteristics.DeviceAddress = GetDeviceAddress();
- ASSERT(m_EndpointDescriptor == FALSE);
+ ASSERT(m_EndpointDescriptor == NULL);
//
// init setup descriptor