Skip to content

Commit

Permalink
Don't overwrite the loop variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
BsAtHome committed Dec 4, 2024
1 parent ca68c1b commit 126b893
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hal/drivers/mesa-hostmot2/hm2_spix.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ static int spix_setup(void)
// Follows SPI0/CE0, SPI0/CE1, SPI1/CE0, SPI1/CE1 and SPI1/CE2
for(j = i = 0; i < SPIX_MAX_BOARDS; i++) {
const spix_port_t *port;
int err;

if(!(spi_probe & (1 << i))) // Only probe if enabled
continue;
Expand All @@ -631,13 +632,13 @@ static int spix_setup(void)
boards[j].llio.send_queued_writes = hm2_spix_send_queued_writes;
}

if((i = probe_board(&boards[j])) < 0) {
return i;
if((err = probe_board(&boards[j])) < 0) {
return err;
}

if((i = hm2_register(&boards[j].llio, config[j])) < 0) {
if((err = hm2_register(&boards[j].llio, config[j])) < 0) {
LL_ERR("%s: hm2_register() failed.\n", port->name);
return i;
return err;
}

j++; // Next board
Expand Down

0 comments on commit 126b893

Please sign in to comment.