[USBPORT] Removing optional braces.

This commit is contained in:
Vadim Galyant 2018-01-11 03:14:22 +09:00 committed by Amine Khaldi
parent c86210e800
commit 2c73523b76

View file

@ -199,10 +199,6 @@ USB2_GetHsOverhead(IN PUSB2_TT_ENDPOINT TtEndpoint,
*OverheadSS = HostDelay + USB2_HS_SS_INTERRUPT_IN_OVERHEAD; *OverheadSS = HostDelay + USB2_HS_SS_INTERRUPT_IN_OVERHEAD;
*OverheadCS = HostDelay + USB2_HS_CS_INTERRUPT_IN_OVERHEAD; *OverheadCS = HostDelay + USB2_HS_CS_INTERRUPT_IN_OVERHEAD;
} }
//DPRINT("USB2_GetHsOverhead: *OverheadSS - %X, *OverheadCS - %X\n",
// *OverheadSS,
// *OverheadCS);
} }
} }
@ -536,9 +532,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
uframe = TtEndpoint->StartMicroframe; uframe = TtEndpoint->StartMicroframe;
if (TtEndpoint->StartMicroframe == 0xFF) if (TtEndpoint->StartMicroframe == 0xFF)
{
USB2_GetPrevMicroFrame(&frame, &uframe); USB2_GetPrevMicroFrame(&frame, &uframe);
}
for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++)
{ {
@ -566,9 +560,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
uframe = TtEndpoint->StartMicroframe; uframe = TtEndpoint->StartMicroframe;
if (TtEndpoint->StartMicroframe == 0xFF) if (TtEndpoint->StartMicroframe == 0xFF)
{
USB2_GetPrevMicroFrame(&frame, &uframe); USB2_GetPrevMicroFrame(&frame, &uframe);
}
DataTime = 0; DataTime = 0;
@ -577,13 +569,9 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
DataSize = PktSizeBitStuff - DataTime; DataSize = PktSizeBitStuff - DataTime;
if (DataSize <= USB2_FS_RAW_BYTES_IN_MICROFRAME) if (DataSize <= USB2_FS_RAW_BYTES_IN_MICROFRAME)
{
CurrentDataTime = PktSizeBitStuff - DataTime; CurrentDataTime = PktSizeBitStuff - DataTime;
}
else else
{
CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME; CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME;
}
HcExtension->TimeUsed[frame][uframe] -= CurrentDataTime; HcExtension->TimeUsed[frame][uframe] -= CurrentDataTime;
USB2_IncMicroFrame(&frame, &uframe); USB2_IncMicroFrame(&frame, &uframe);
@ -598,13 +586,9 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint,
for (ix = 0; ix < TtEndpoint->Nums.NumCompletes; ix++) for (ix = 0; ix < TtEndpoint->Nums.NumCompletes; ix++)
{ {
if (PktSizeBitStuff >= USB2_FS_RAW_BYTES_IN_MICROFRAME) if (PktSizeBitStuff >= USB2_FS_RAW_BYTES_IN_MICROFRAME)
{
CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME; CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME;
}
else else
{
CurrentDataTime = PktSizeBitStuff; CurrentDataTime = PktSizeBitStuff;
}
Tt->TimeCS[frame][uframe] -= CurrentDataTime; Tt->TimeCS[frame][uframe] -= CurrentDataTime;
@ -727,13 +711,9 @@ USB2_CommonFrames(IN PUSB2_TT_ENDPOINT NextTtEndpoint,
} }
if (NextTtEndpoint->ActualPeriod < TtEndpoint->ActualPeriod) if (NextTtEndpoint->ActualPeriod < TtEndpoint->ActualPeriod)
{
Frame = TtEndpoint->StartFrame % TtEndpoint->ActualPeriod; Frame = TtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
}
else else
{
Frame = NextTtEndpoint->StartFrame % TtEndpoint->ActualPeriod; Frame = NextTtEndpoint->StartFrame % TtEndpoint->ActualPeriod;
}
return (Frame == TtEndpoint->StartFrame); return (Frame == TtEndpoint->StartFrame);
} }
@ -821,9 +801,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint)
Direction = TtEndpoint->TtEndpointParams.Direction; Direction = TtEndpoint->TtEndpointParams.Direction;
if (DeviceSpeed == UsbHighSpeed) if (DeviceSpeed == UsbHighSpeed)
{
return 0; return 0;
}
if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT) if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT)
{ {
@ -837,9 +815,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint)
else else
{ {
if (Direction == USBPORT_TRANSFER_DIRECTION_OUT) if (Direction == USBPORT_TRANSFER_DIRECTION_OUT)
{
return 0; return 0;
}
USB2_ConvertFrame(TtEndpoint->StartFrame, USB2_ConvertFrame(TtEndpoint->StartFrame,
TtEndpoint->StartMicroframe, TtEndpoint->StartMicroframe,
@ -856,9 +832,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint)
NumCompletes--; NumCompletes--;
if (!NumCompletes) if (!NumCompletes)
{
return MaskCS; return MaskCS;
}
} }
for (; NumCompletes; NumCompletes--) for (; NumCompletes; NumCompletes--)
@ -926,8 +900,8 @@ USB2_RebalanceEndpoint(IN PDEVICE_OBJECT FdoDevice,
if (Endpoint->EndpointProperties.Period != NewPeriod) if (Endpoint->EndpointProperties.Period != NewPeriod)
{ {
ASSERT(Endpoint->EndpointProperties.Period);
Factor = USB2_FRAMES / Endpoint->EndpointProperties.Period; Factor = USB2_FRAMES / Endpoint->EndpointProperties.Period;
ASSERT(Factor);
for (ix = 0; ix < Factor; ix++) for (ix = 0; ix < Factor; ix++)
{ {
@ -940,8 +914,8 @@ USB2_RebalanceEndpoint(IN PDEVICE_OBJECT FdoDevice,
Endpoint->EndpointProperties.ScheduleOffset = ScheduleOffset; Endpoint->EndpointProperties.ScheduleOffset = ScheduleOffset;
Endpoint->EndpointProperties.UsbBandwidth = EndpointBandwidth; Endpoint->EndpointProperties.UsbBandwidth = EndpointBandwidth;
ASSERT(NewPeriod);
Factor = USB2_FRAMES / NewPeriod; Factor = USB2_FRAMES / NewPeriod;
ASSERT(Factor);
for (ix = 0; ix < Factor; ix++) for (ix = 0; ix < Factor; ix++)
{ {
@ -1135,13 +1109,9 @@ USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint,
} }
if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT) if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT)
{
endpoint = Tt->FrameBudget[frame].IntEndpoint; endpoint = Tt->FrameBudget[frame].IntEndpoint;
}
else else
{
endpoint = Tt->FrameBudget[frame].IsoEndpoint; endpoint = Tt->FrameBudget[frame].IsoEndpoint;
}
nextEndpoint = endpoint->NextTtEndpoint; nextEndpoint = endpoint->NextTtEndpoint;
@ -1481,13 +1451,9 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
} }
if (Speed == UsbLowSpeed) if (Speed == UsbLowSpeed)
{
TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize * 8 + Overhead; TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize * 8 + Overhead;
}
else else
{
TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize + Overhead; TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize + Overhead;
}
LatestStart = USB2_HUB_DELAY + USB2_FS_SOF_TIME; LatestStart = USB2_HUB_DELAY + USB2_FS_SOF_TIME;
@ -1514,9 +1480,7 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
nextEndpoint = nextEndpoint->NextTtEndpoint) nextEndpoint = nextEndpoint->NextTtEndpoint)
{ {
if (USB2_CheckTtEndpointInsert(nextEndpoint, TtEndpoint)) if (USB2_CheckTtEndpointInsert(nextEndpoint, TtEndpoint))
{
break; break;
}
prevEndpoint = nextEndpoint; prevEndpoint = nextEndpoint;
} }
@ -1526,8 +1490,7 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint,
prevEndpoint, prevEndpoint,
frame); frame);
if (StartTime > LatestStart) LatestStart = max(LatestStart, StartTime);
LatestStart = StartTime;
} }
TtEndpoint->StartTime = LatestStart; TtEndpoint->StartTime = LatestStart;
@ -2026,8 +1989,8 @@ USBPORT_AllocateBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
ScheduleOffset = Endpoint->TtEndpoint->StartFrame; ScheduleOffset = Endpoint->TtEndpoint->StartFrame;
EndpointProperties->ScheduleOffset = ScheduleOffset; EndpointProperties->ScheduleOffset = ScheduleOffset;
ASSERT(ActualPeriod);
Factor = USB2_FRAMES / ActualPeriod; Factor = USB2_FRAMES / ActualPeriod;
ASSERT(Factor);
n = ScheduleOffset * Factor; n = ScheduleOffset * Factor;
@ -2183,9 +2146,7 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice,
USB2_Rebalance(FdoDevice, &RebalanceList); USB2_Rebalance(FdoDevice, &RebalanceList);
if (!TtExtension) if (!TtExtension)
{
return; return;
}
for (ix = 0; ix < USB2_FRAMES; ix++) for (ix = 0; ix < USB2_FRAMES; ix++)
{ {