/* Returns pointer to current completion descriptor to consume  */
STATIC PVSCSI_RING_CMP_DESC* PvScsiGetCurrentResponse(IN CONST PVSCSI_DEV *Dev)
/* Returns pointer to current completion descriptor to consume  */
STATIC PVSCSI_RING_CMP_DESC* PvScsiGetCurrentResponse(IN CONST PVSCSI_DEV *Dev)
{
  PVSCSI_RINGS_STATE  *RingState;
  UINT32              CmpNumEntries;
  RingState     = Dev->RingDesc.RingState;
  CmpNumEntries = 1U << RingState->CmpNumEntriesLog2;
  return Dev->RingDesc.RingCmps +
         (RingState->CmpConsIdx & (CmpNumEntries - 1));
}