From: Mark Adamenko <marusik.adamenko@gmail.com>
To: linux-staging@lists.linux.dev
Cc: parthiban.veerasooran@microchip.com,
christian.gromm@microchip.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org,
Mark Adamenko <marusik.adamenko@gmail.com>
Subject: [PATCH v2] staging: most: dim2: replace ROUND_UP_TO macro with round_up()
Date: Thu, 5 Mar 2026 18:19:26 -0800 [thread overview]
Message-ID: <20260306021926.7475-1-marusik.adamenko@gmail.com> (raw)
The ROUND_UP_TO macro reuses argument 'd', which can cause unintended
side effects. Remove it and replace the macro call with the existing
round_up() function.
Signed-off-by: Mark Adamenko <marusik.adamenko@gmail.com>
---
v2: use existing round_up() instead of a custom inline function
---
drivers/staging/most/dim2/hal.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/most/dim2/hal.c b/drivers/staging/most/dim2/hal.c
index 6abe3ab2b2cf..ae9006703f23 100644
--- a/drivers/staging/most/dim2/hal.c
+++ b/drivers/staging/most/dim2/hal.c
@@ -45,8 +45,6 @@
#define DBR_SIZE (16 * 1024) /* specified by IP */
#define DBR_BLOCK_SIZE (DBR_SIZE / 32 / DBR_MAP_SIZE)
-#define ROUND_UP_TO(x, d) (DIV_ROUND_UP(x, (d)) * (d))
-
/* -------------------------------------------------------------------------- */
/* generic helper functions and macros */
@@ -758,7 +756,7 @@ static u8 init_ctrl_async(struct dim_channel *ch, u8 type, u8 is_tx,
return DIM_INIT_ERR_CHANNEL_ADDRESS;
if (!ch->dbr_size)
- ch->dbr_size = ROUND_UP_TO(hw_buffer_size, DBR_BLOCK_SIZE);
+ ch->dbr_size = round_up(hw_buffer_size, DBR_BLOCK_SIZE);
ch->dbr_addr = alloc_dbr(ch->dbr_size);
if (ch->dbr_addr >= DBR_SIZE)
return DIM_INIT_ERR_OUT_OF_MEMORY;
--
2.53.0
next reply other threads:[~2026-03-06 2:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-06 2:19 Mark Adamenko [this message]
2026-03-06 7:37 ` [PATCH v2] staging: most: dim2: replace ROUND_UP_TO macro with round_up() Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260306021926.7475-1-marusik.adamenko@gmail.com \
--to=marusik.adamenko@gmail.com \
--cc=christian.gromm@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=parthiban.veerasooran@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox