PVS V529: ; after while

Just rewrite the loop in a more readable way.

Change-Id: I174016eac74eb54a01e5226b5f8a92fb1b335830
Reviewed-on: https://review.haiku-os.org/c/1665
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Adrien Destugues
2019-07-31 02:13:01 +00:00
committed by waddlesplash
parent e66c5b32a8
commit 679c751309
@@ -226,38 +226,43 @@ bool Radeon_VIPWrite(device_info *di, uint8 channel, uint address, uint32 data,
static bool do_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer) static bool do_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer)
{ {
vuint8 *regs = di->regs; vuint8 *regs = di->regs;
uint32 status; uint32 status;
uint32 i; uint32 i;
SHOW_FLOW( 2, "address=%lx, count=%ld, ", address, count ); SHOW_FLOW( 2, "address=%lx, count=%ld, ", address, count );
Radeon_WaitForFifo( di, 2 ); Radeon_WaitForFifo( di, 2 );
OUTREG( regs, RADEON_VIPH_REG_ADDR, ((channel << 14) | address | 0x1000) & ~0x2000 ); OUTREG( regs, RADEON_VIPH_REG_ADDR, ((channel << 14) | address | 0x1000) & ~0x2000 );
SHOW_FLOW0( 2, "1"); SHOW_FLOW0( 2, "1");
while(B_BUSY == (status = RADEON_VIPFifoIdle( di, 0x0f))); do {
status = RADEON_VIPFifoIdle(di, 0x0f);
} while (status == B_BUSY);
if(B_OK != status){
if(B_OK != status){
SHOW_FLOW( 2 ,"cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address); SHOW_FLOW( 2 ,"cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address);
return false; return false;
} }
SHOW_FLOW0( 2, "2"); SHOW_FLOW0( 2, "2");
for (i = 0; i < count; i+=4) for (i = 0; i < count; i+=4)
{ {
Radeon_WaitForFifo( di, 2); Radeon_WaitForFifo( di, 2);
SHOW_FLOW( 2, "count %ld", count); SHOW_FLOW( 2, "count %ld", count);
OUTREG( regs, RADEON_VIPH_REG_DATA, *(uint32*)(buffer + i)); OUTREG( regs, RADEON_VIPH_REG_DATA, *(uint32*)(buffer + i));
while(B_BUSY == (status = RADEON_VIPFifoIdle( di, 0x0f)));
do {
status = RADEON_VIPFifoIdle(di, 0x0f);
} while (status == B_BUSY);
if(B_OK != status) if(B_OK != status)
{ {
SHOW_FLOW0( 2 , "cannot write to VIPH_REG_DATA\n"); SHOW_FLOW0( 2 , "cannot write to VIPH_REG_DATA\n");
return false; return false;
} }
} }
return true; return true;
} }
bool Radeon_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock) bool Radeon_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock)