Skip to content

Commit

Permalink
bootloader: use ceiling_fraction() instead of open-coding it
Browse files Browse the repository at this point in the history
Use the existing ceiling_fraction() function instead of open-
coding it.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Jan 5, 2021
1 parent 692d3dd commit 623d235
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions soc/xtensa/intel_adsp/common/bootloader/boot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ static uint32_t hp_sram_power_on_memory(uint32_t memory_size)
/* calculate total number of used SRAM banks (EBB)
* to power up only necessary banks
*/
ebb_in_use = (!(memory_size % SRAM_BANK_SIZE)) ?
(memory_size / SRAM_BANK_SIZE) :
(memory_size / SRAM_BANK_SIZE) + 1;
ebb_in_use = ceiling_fraction(memory_size, SRAM_BANK_SIZE);

return hp_sram_pm_banks(ebb_in_use);
}
Expand Down

0 comments on commit 623d235

Please sign in to comment.