git: dc048255b37e - main - mlx5: use roundup_pow_of_two

From: Doug Moore <dougm_at_FreeBSD.org>
Date: Mon, 24 Jun 2024 07:27:57 UTC
The branch main has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=dc048255b37e1e36090bb42e5297f97dbcd31c5c

commit dc048255b37e1e36090bb42e5297f97dbcd31c5c
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2024-06-24 07:22:52 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2024-06-24 07:22:52 +0000

    mlx5: use roundup_pow_of_two
    
    Use roundup_pow_of_two in place of an expression.
    
    Reviewed by:    alc, markj
    Differential Revision:  https://reviews.freebsd.org/D45536
---
 sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
index 4d9d1048448b..602a94345e50 100644
--- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
@@ -2331,7 +2331,7 @@ mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs)
 	 * Stride size is 16 * (n + 1), as the first segment is
 	 * control.
 	 */
-	n = (1 << fls(howmany(r, MLX5E_MAX_RX_BYTES))) - 1;
+	n = roundup_pow_of_two(1 + howmany(r, MLX5E_MAX_RX_BYTES)) - 1;
 	if (n > MLX5E_MAX_BUSDMA_RX_SEGS)
 		return (-ENOMEM);