mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-07 07:46:59 +02:00
arm: socfpga: Remove unnecessary for loop
The for loop in fpgamgr_program_poll_cd will always terminate after a single pass and so is not necessary. Remove it and all related code and leave only the code that is effective. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
This commit is contained in:
parent
46d5cf3847
commit
f4aa24af69
@ -119,10 +119,8 @@ static int fpgamgr_program_poll_cd(void)
|
|||||||
{
|
{
|
||||||
const uint32_t mask = FPGAMGRREGS_MON_GPIO_EXT_PORTA_NS_MASK |
|
const uint32_t mask = FPGAMGRREGS_MON_GPIO_EXT_PORTA_NS_MASK |
|
||||||
FPGAMGRREGS_MON_GPIO_EXT_PORTA_CD_MASK;
|
FPGAMGRREGS_MON_GPIO_EXT_PORTA_CD_MASK;
|
||||||
unsigned long reg, i;
|
unsigned long reg;
|
||||||
|
|
||||||
/* (3) wait until full config done */
|
|
||||||
for (i = 0; i < FPGA_TIMEOUT_CNT; i++) {
|
|
||||||
reg = readl(&fpgamgr_regs->gpio_ext_porta);
|
reg = readl(&fpgamgr_regs->gpio_ext_porta);
|
||||||
|
|
||||||
/* Config error */
|
/* Config error */
|
||||||
@ -131,17 +129,6 @@ static int fpgamgr_program_poll_cd(void)
|
|||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Config done without error */
|
|
||||||
if (reg & mask)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Timeout happened, return error */
|
|
||||||
if (i == FPGA_TIMEOUT_CNT) {
|
|
||||||
printf("FPGA: Timeout waiting for program.\n");
|
|
||||||
return -4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Disable AXI configuration */
|
/* Disable AXI configuration */
|
||||||
clrbits_le32(&fpgamgr_regs->ctrl, FPGAMGRREGS_CTRL_AXICFGEN_MASK);
|
clrbits_le32(&fpgamgr_regs->ctrl, FPGAMGRREGS_CTRL_AXICFGEN_MASK);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user