From ad7a40feaff050319a73d315ef1242a1d8259c7b Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Tue, 10 May 2022 08:58:55 +0200 Subject: [PATCH] Use internal implementation of DIV_ROUND_UP It's required, because environments other than Linux kernel may not define their own DIV_ROUND_UP. Moving it to env would just generate boilerplate, because its implementation is trivial and portable. Signed-off-by: Robert Baldyga --- src/cleaning/acp.c | 4 ++-- src/cleaning/alru.c | 4 ++-- src/ocf_lru.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cleaning/acp.c b/src/cleaning/acp.c index bc2db7f..07f6a76 100644 --- a/src/cleaning/acp.c +++ b/src/cleaning/acp.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2012-2021 Intel Corporation + * Copyright(c) 2012-2022 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ @@ -363,7 +363,7 @@ static int ocf_acp_recovery_handle(ocf_parallelize_t parallelize, ocf_core_id_t core_id; uint32_t step = 0; - portion = DIV_ROUND_UP((uint64_t)entries, shards_cnt); + portion = OCF_DIV_ROUND_UP((uint64_t)entries, shards_cnt); begin = portion*shard_id; end = OCF_MIN(portion*(shard_id + 1), entries); diff --git a/src/cleaning/alru.c b/src/cleaning/alru.c index babbde7..a2ec098 100644 --- a/src/cleaning/alru.c +++ b/src/cleaning/alru.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2012-2021 Intel Corporation + * Copyright(c) 2012-2022 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ @@ -516,7 +516,7 @@ static int ocf_alru_recovery_handle(ocf_parallelize_t parallelize, uint32_t step = 0; int i; - portion = DIV_ROUND_UP((uint64_t)entries, shards_cnt); + portion = OCF_DIV_ROUND_UP((uint64_t)entries, shards_cnt); begin = portion*shard_id; end = OCF_MIN((uint64_t)portion*(shard_id + 1), entries); diff --git a/src/ocf_lru.c b/src/ocf_lru.c index 0062023..d617b98 100644 --- a/src/ocf_lru.c +++ b/src/ocf_lru.c @@ -1,5 +1,5 @@ /* - * Copyright(c) 2012-2021 Intel Corporation + * Copyright(c) 2012-2022 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ @@ -891,7 +891,7 @@ static int ocf_lru_populate_handle(ocf_parallelize_t parallelize, uint32_t portion, offset; uint32_t i, idx; - portion = DIV_ROUND_UP((uint64_t)entries, shards_cnt); + portion = OCF_DIV_ROUND_UP((uint64_t)entries, shards_cnt); offset = shard_id * portion / shards_cnt; ocf_generator_bisect_init(&generator, portion, offset);