This patch renames all local variables in function GetNextTargetBufferLocation for readability purposes. Signed-off-by: Kevin McKinney <klmckinney1@xxxxxxxxx> --- drivers/staging/bcm/CmHost.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c index 325b592..48302ee 100644 --- a/drivers/staging/bcm/CmHost.c +++ b/drivers/staging/bcm/CmHost.c @@ -1573,36 +1573,36 @@ ULONG SetUpTargetDsxBuffers(struct bcm_mini_adapter *Adapter) static ULONG GetNextTargetBufferLocation(struct bcm_mini_adapter *Adapter, B_UINT16 tid) { - ULONG ulTargetDSXBufferAddress; - ULONG ulTargetDsxBufferIndexToUse, ulMaxTry; + ULONG dsx_buf; + ULONG idx, max_try; if ((Adapter->ulTotalTargetBuffersAvailable == 0) || (Adapter->ulFreeTargetBufferCnt == 0)) { ClearTargetDSXBuffer(Adapter, tid, FALSE); return 0; } - ulTargetDsxBufferIndexToUse = Adapter->ulCurrentTargetBuffer; - ulMaxTry = Adapter->ulTotalTargetBuffersAvailable; - while ((ulMaxTry) && (Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid != 1)) { - ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1) % Adapter->ulTotalTargetBuffersAvailable; - ulMaxTry--; + idx = Adapter->ulCurrentTargetBuffer; + max_try = Adapter->ulTotalTargetBuffersAvailable; + while ((max_try) && (Adapter->astTargetDsxBuffer[idx].valid != 1)) { + idx = (idx+1) % Adapter->ulTotalTargetBuffersAvailable; + max_try--; } - if (ulMaxTry == 0) { + if (max_try == 0) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "\n GetNextTargetBufferLocation : Error No Free Target DSX Buffers FreeCnt : %lx ", Adapter->ulFreeTargetBufferCnt); ClearTargetDSXBuffer(Adapter, tid, FALSE); return 0; } - ulTargetDSXBufferAddress = Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].ulTargetDsxBuffer; - Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].valid = 0; - Adapter->astTargetDsxBuffer[ulTargetDsxBufferIndexToUse].tid = tid; + dsx_buf = Adapter->astTargetDsxBuffer[idx].ulTargetDsxBuffer; + Adapter->astTargetDsxBuffer[idx].valid = 0; + Adapter->astTargetDsxBuffer[idx].tid = tid; Adapter->ulFreeTargetBufferCnt--; - ulTargetDsxBufferIndexToUse = (ulTargetDsxBufferIndexToUse+1)%Adapter->ulTotalTargetBuffersAvailable; - Adapter->ulCurrentTargetBuffer = ulTargetDsxBufferIndexToUse; - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n", ulTargetDSXBufferAddress, tid); + idx = (idx+1)%Adapter->ulTotalTargetBuffersAvailable; + Adapter->ulCurrentTargetBuffer = idx; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "GetNextTargetBufferLocation :Returning address %lx tid %d\n", dsx_buf, tid); - return ulTargetDSXBufferAddress; + return dsx_buf; } int AllocAdapterDsxBuffer(struct bcm_mini_adapter *Adapter) -- 1.7.9.5 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel