From 1f6627b4b59de3f9ed859ac351fd364a5c7fce68 Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Thu, 13 Apr 2023 21:50:39 -0600 Subject: zephyr: Remove deprecated calls to ceiling_fraction() The ceiling_fraction() macro was deprecated, use DIV_ROUND_UP() instead. BRANCH=none BUG=none TEST=zmake build --all Change-Id: I1dede993fbaebb0fb50f8082412196a0ffdb9c75 Signed-off-by: Yuval Peress Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4426789 Commit-Queue: Al Semjonovs Reviewed-by: Al Semjonovs --- zephyr/drivers/cros_system/cros_system_npcx.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zephyr/drivers/cros_system/cros_system_npcx.c b/zephyr/drivers/cros_system/cros_system_npcx.c index 01e7f1efe6..45009709cf 100644 --- a/zephyr/drivers/cros_system/cros_system_npcx.c +++ b/zephyr/drivers/cros_system/cros_system_npcx.c @@ -10,6 +10,7 @@ #include "soc_gpio.h" #include "soc_miwu.h" #include "system.h" +#include "util.h" #include #include @@ -280,9 +281,9 @@ system_npcx_hibernate_by_lfw_in_last_ram(const struct device *dev, static inline int system_npcx_get_ram_blk_by_lfw_addr(char *address) { return NPCX_RAM_BLOCK_COUNT - - ceiling_fraction((uint32_t)address - - CONFIG_CROS_EC_PROGRAM_MEMORY_BASE, - NPCX_RAM_BLOCK_SIZE); + DIV_ROUND_UP((uint32_t)address - + CONFIG_CROS_EC_PROGRAM_MEMORY_BASE, + NPCX_RAM_BLOCK_SIZE); } static void system_npcx_hibernate_by_disable_ram(const struct device *dev, -- cgit v1.2.1