From 679c7513099d2d2a82b739b339b226785ae63890 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 30 Jul 2019 20:29:29 +0200 Subject: [PATCH] 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 --- .../kernel/drivers/graphics/radeon/vip.c | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/add-ons/kernel/drivers/graphics/radeon/vip.c b/src/add-ons/kernel/drivers/graphics/radeon/vip.c index 9c5c2b7e27..e4fcef35bf 100644 --- a/src/add-ons/kernel/drivers/graphics/radeon/vip.c +++ b/src/add-ons/kernel/drivers/graphics/radeon/vip.c @@ -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) { vuint8 *regs = di->regs; - - uint32 status; + + uint32 status; uint32 i; - + SHOW_FLOW( 2, "address=%lx, count=%ld, ", address, count ); - Radeon_WaitForFifo( di, 2 ); - OUTREG( regs, RADEON_VIPH_REG_ADDR, ((channel << 14) | address | 0x1000) & ~0x2000 ); - SHOW_FLOW0( 2, "1"); - while(B_BUSY == (status = RADEON_VIPFifoIdle( di, 0x0f))); - - - if(B_OK != status){ + Radeon_WaitForFifo( di, 2 ); + OUTREG( regs, RADEON_VIPH_REG_ADDR, ((channel << 14) | address | 0x1000) & ~0x2000 ); + SHOW_FLOW0( 2, "1"); + do { + status = RADEON_VIPFifoIdle(di, 0x0f); + } while (status == B_BUSY); + + if(B_OK != status){ SHOW_FLOW( 2 ,"cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address); return false; } - - SHOW_FLOW0( 2, "2"); + + SHOW_FLOW0( 2, "2"); for (i = 0; i < count; i+=4) { Radeon_WaitForFifo( di, 2); SHOW_FLOW( 2, "count %ld", count); 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) { SHOW_FLOW0( 2 , "cannot write to VIPH_REG_DATA\n"); return false; - } + } } - return true; + return true; } bool Radeon_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock)