Index: trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
===================================================================
--- trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 34827)
+++ trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 34828)
@@ -664,5 +664,5 @@
 #endif
     return 0;
-} 
+}
 
 static int hdaProcessInterrupt(INTELHDLinkState* pState)
@@ -848,7 +848,7 @@
 {
     Log(("hda: reset of stream (%d) started\n", u8Strm));
-    Assert((   pState 
-            && pBdle 
-            && pStreamDesc 
+    Assert((   pState
+            && pBdle
+            && pStreamDesc
             && u8Strm <= 7));
     memset(pBdle, 0, sizeof(HDABDLEDESC));
@@ -1063,15 +1063,15 @@
     bool fInRun = RT_BOOL((HDA_REG_IND(pState, index) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)));
     bool fReset = RT_BOOL((u32Value & HDA_REG_FIELD_FLAG_MASK(SDCTL, SRST)));
-    bool fInReset = RT_BOOL((HDA_REG_IND(pState, index) & HDA_REG_FIELD_FLAG_MASK(SDCTL, SRST))); 
+    bool fInReset = RT_BOOL((HDA_REG_IND(pState, index) & HDA_REG_FIELD_FLAG_MASK(SDCTL, SRST)));
     int rc = VINF_SUCCESS;
     if (fInReset)
     {
-        /* Assert!!! Guest is resetting HDA's stream, we're expecting guest will mark stream as exit 
-         * from reset 
+        /* Assert!!! Guest is resetting HDA's stream, we're expecting guest will mark stream as exit
+         * from reset
          */
         Assert((!fReset));
         Log(("hda: guest initiate exit of stream reset.\n"));
         goto done;
-    } 
+    }
     else if (fReset)
     {
@@ -1187,14 +1187,14 @@
                 case HDA_SDONFIFO_192B:
                     return hdaRegWriteU16(pState, offset, index, u32Value);
-                    
+
                 case HDA_SDONFIFO_256B:
                     Log(("hda: 256 bit is unsupported, HDA is switched into 192B mode\n"));
                 default:
                     return hdaRegWriteU16(pState, offset, index, HDA_SDONFIFO_192B);
-            } 
+            }
             return VINF_SUCCESS;
         default:
             AssertMsgFailed(("Something wierd happens with register lookup routine"));
-    } 
+    }
     return VINF_SUCCESS;
 }
@@ -1364,6 +1364,6 @@
 {
     uint8_t  bdle[16];
-    Assert((   pStreamDesc->u64BaseDMA 
-            && pBdle 
+    Assert((   pStreamDesc->u64BaseDMA
+            && pBdle
             && pBdle->u32BdleMaxCvi));
     PDMDevHlpPhysRead(ICH6_HDASTATE_2_DEVINS(pState), pStreamDesc->u64BaseDMA + pBdle->u32BdleCvi*16, bdle, 16);
@@ -1394,12 +1394,12 @@
     Assert((pBdle->u32BdleCviLen >= pBdle->u32BdleCviPos)); /* sanity */
     cb2Copy = pBdle->u32BdleCviLen - pBdle->u32BdleCviPos;
-    /* 
-     * we may increase the counter in range of [0, FIFOS + 1] 
+    /*
+     * we may increase the counter in range of [0, FIFOS + 1]
      */
-    cb2Copy = RT_MIN(cb2Copy, pStreamDesc->u32Fifos + 1); 
+    cb2Copy = RT_MIN(cb2Copy, pStreamDesc->u32Fifos + 1);
     Assert((u32SoundBackendBufferBytesAvail > 0));
 
     /* sanity check to avoid overriding sound backend buffer */
-    cb2Copy = RT_MIN(cb2Copy, u32SoundBackendBufferBytesAvail); 
+    cb2Copy = RT_MIN(cb2Copy, u32SoundBackendBufferBytesAvail);
     cb2Copy = RT_MIN(cb2Copy, u32CblLimit);
 
@@ -1412,9 +1412,9 @@
 static inline void hdaBackendWriteTransferReported(PHDABDLEDESC pBdle, uint32_t cbArranged2Copy, uint32_t cbCopied, uint32_t *pu32DMACursor, uint32_t *pu32BackendBufferCapacity)
 {
-    Log(("hda:hdaBackendWriteTransferReported: cbArranged2Copy: %d, cbCopied: %d, pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n", 
+    Log(("hda:hdaBackendWriteTransferReported: cbArranged2Copy: %d, cbCopied: %d, pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n",
         cbArranged2Copy, cbCopied, pu32DMACursor ? *pu32DMACursor : 0, pu32BackendBufferCapacity ? *pu32BackendBufferCapacity : 0));
     Assert((cbCopied));
     Assert((pu32BackendBufferCapacity && *pu32BackendBufferCapacity));
-    /* Assertion!!! It was copied less than cbUnderFifoW 
+    /* Assertion!!! It was copied less than cbUnderFifoW
      * Probably we need to move the buffer, but it rather hard to imagine situation
      * why it may happen.
@@ -1424,6 +1424,6 @@
         && pBdle->cbUnderFifoW <= cbCopied)
         Log(("hda:hdaBackendWriteTransferReported: CVI resetting cbUnderFifoW:%d(pos:%d, len:%d)\n", pBdle->cbUnderFifoW, pBdle->u32BdleCviPos, pBdle->u32BdleCviLen));
-    
-    pBdle->cbUnderFifoW -= RT_MIN(pBdle->cbUnderFifoW, cbCopied); 
+
+    pBdle->cbUnderFifoW -= RT_MIN(pBdle->cbUnderFifoW, cbCopied);
     Assert((!pBdle->cbUnderFifoW)); /* Assert!!! Assumption failed */
 
@@ -1433,8 +1433,8 @@
     Assert((pBdle->u32BdleCviLen >= pBdle->u32BdleCviPos && *pu32BackendBufferCapacity >= cbCopied)); /* sanity */
     /* We reports all bytes (including unreported previously) */
-    *pu32DMACursor += cbCopied; 
+    *pu32DMACursor += cbCopied;
     /* reducing backend counter on amount of bytes we copied to backend */
     *pu32BackendBufferCapacity -= cbCopied;
-    Log(("hda:hdaBackendWriteTransferReported: CVI(pos:%d, len:%d), pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n", 
+    Log(("hda:hdaBackendWriteTransferReported: CVI(pos:%d, len:%d), pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n",
         pBdle->u32BdleCviPos, pBdle->u32BdleCviLen, *pu32DMACursor, *pu32BackendBufferCapacity));
 }
@@ -1448,5 +1448,5 @@
     *pu32DMACursor += cbCopied + pBdle->cbUnderFifoW;
     pBdle->cbUnderFifoW = 0;
-    Log(("hda:hdaBackendReadTransferReported: CVI(pos:%d, len:%d), pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n", 
+    Log(("hda:hdaBackendReadTransferReported: CVI(pos:%d, len:%d), pu32DMACursor: %d, pu32BackendBufferCapacity:%d\n",
         pBdle->u32BdleCviPos, pBdle->u32BdleCviLen, pu32DMACursor ? *pu32DMACursor : 0, pu32BackendBufferCapacity ? *pu32BackendBufferCapacity : 0));
 }
@@ -1471,5 +1471,5 @@
         *pStreamDesc->pu32Lpib -= pStreamDesc->u32Cbl;
     hdaUpdatePosBuf(pState, pStreamDesc);
-    
+
     if (pBdle->u32BdleCviPos == pBdle->u32BdleCviLen)
     {
@@ -1491,12 +1491,12 @@
     {
         *pStreamDesc->pu32Lpib += cbInc;
-    
+
         /*
          * Assert. Overlapping of buffer counter shouldn't happen.
          */
         Assert((*pStreamDesc->pu32Lpib <= pStreamDesc->u32Cbl));
-    
+
         hdaUpdatePosBuf(pState, pStreamDesc);
-    
+
     }
 }
@@ -1523,5 +1523,5 @@
                 hdaProcessInterrupt(pState);
         }
-        fDoNextTransferLoop = false; 
+        fDoNextTransferLoop = false;
     }
     return fDoNextTransferLoop;
@@ -1530,5 +1530,5 @@
 /*
  * hdaReadAudio - copies samples from Qemu Sound back-end to DMA.
- * Note: this function writes immediately to DMA buffer, but "reports bytes" when all conditions meet (FIFOW)  
+ * Note: this function writes immediately to DMA buffer, but "reports bytes" when all conditions meet (FIFOW)
  */
 static uint32_t hdaReadAudio(INTELHDLinkState *pState, PHDASTREAMTRANSFERDESC pStreamDesc, uint32_t *pu32Avail, bool *fStop, uint32_t u32CblLimit)
@@ -1548,6 +1548,6 @@
         goto done;
     }
-        
-    
+
+
     /*
      * read from backend input line to last ureported position or at the begining.
@@ -1585,5 +1585,5 @@
 
     cb2Copy = hdaCalculateTransferBufferLength(pBdle, pStreamDesc, *pu32Avail, u32CblLimit);
-    
+
     /*
      * Copy from DMA to the corresponding hdaBuffer (if there exists some bytes from the previous not reported transfer we write to ''pBdle->cbUnderFifoW'' offset)
@@ -1594,5 +1594,5 @@
         goto done;
     }
-        
+
     PDMDevHlpPhysRead(ICH6_HDASTATE_2_DEVINS(pState), pBdle->u64BdleCviAddr + pBdle->u32BdleCviPos, pBdle->au8HdaBuffer + pBdle->cbUnderFifoW, cb2Copy);
     /*
@@ -1628,8 +1628,8 @@
 static inline void hdaInitTransferDescriptor(PINTELHDLinkState pState, PHDABDLEDESC pBdle, uint8_t u8Strm, PHDASTREAMTRANSFERDESC pStreamDesc)
 {
-    Assert((   pState 
-            && pBdle 
+    Assert((   pState
+            && pBdle
             && pStreamDesc
-            && u8Strm <= 7));                
+            && u8Strm <= 7));
     memset(pStreamDesc, 0, sizeof(HDASTREAMTRANSFERDESC));
     pStreamDesc->u8Strm = u8Strm;
@@ -1651,5 +1651,5 @@
     }
 #endif
-} 
+}
 
 DECLCALLBACK(void) hdaTransfer(CODECState *pCodecState, ENMSOUNDSOURCE src, int avail)
@@ -1709,5 +1709,5 @@
         Assert(nBytes <= (stStreamDesc.u32Fifos + 1));
         *stStreamDesc.pu32Sts &= ~HDA_REG_FIELD_FLAG_MASK(SDSTS, FIFORDY);
-        
+
         /* Process end of buffer condition. */
         hdaStreamCounterUpdate(pState, pBdle, &stStreamDesc, nBytes);
@@ -1993,5 +1993,5 @@
         hdaInitTransferDescriptor(&pThis->hda, pBdle, u8Strm, &stStreamDesc);
         /* hdaStreamReset prevents changing SRST bit, so we zerro it here forcely. */
-        HDA_STREAM_REG2(&pThis->hda, CTL, u8Strm) = 0; 
+        HDA_STREAM_REG2(&pThis->hda, CTL, u8Strm) = 0;
         hdaStreamReset(&pThis->hda, pBdle, &stStreamDesc, u8Strm);
     }
