From a518366a894e7b44b1b7c815a13286f7147597d2 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 5 Jan 2021 12:19:43 +0100 Subject: [PATCH] bootloader: use ceiling_fraction() instead of open-coding it Use the existing ceiling_fraction() function instead of open- coding it. Signed-off-by: Guennadi Liakhovetski --- soc/xtensa/intel_adsp/common/bootloader/boot_loader.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c b/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c index 3a8eda3da05120..13919c093062c9 100644 --- a/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c +++ b/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c @@ -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); }