]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: most: dim2: replace ROUND_UP_TO macro with round_up()
authorMark Adamenko <marusik.adamenko@gmail.com>
Fri, 6 Mar 2026 02:19:26 +0000 (18:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Mar 2026 16:49:36 +0000 (17:49 +0100)
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>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/20260306021926.7475-1-marusik.adamenko@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/hal.c

index cebde0ce2701c767cbf42fdeb4075c055cb98114..38376d3e3f0d4afdf3e367e94b9dddc3749aff56 100644 (file)
@@ -44,8 +44,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 */
 
@@ -757,7 +755,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;