On 2/13/25 1:10 AM, Justin Stitt wrote:
On Tue, Feb 11, 2025 at 6:22 AM Tariq Toukan [off-list ref] wrote:
quoted
On 11/02/2025 2:01, Justin Stitt wrote:
quoted
quoted
diff --git a/drivers/net/ethernet/mellanox/mlx4/alloc.c b/drivers/net/ethernet/mellanox/mlx4/alloc.c
index b330020dc0d6..f2bded847e61 100644
--- a/drivers/net/ethernet/mellanox/mlx4/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx4/alloc.c
@@ -682,9 +682,9 @@ static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device)
}
static int mlx4_alloc_db_from_pgdir(struct mlx4_db_pgdir *pgdir,
- struct mlx4_db *db, int order)
+ struct mlx4_db *db, unsigned int order)
{
- int o;
+ unsigned int o;
int i;
for (o = order; o <= 1; ++o) {
^ Knowing now that @order can only be 0 or 1 can this for loop (and
goto) be dropped entirely?
Maybe I'm missing something...
Can you please explain why you think this can be dropped?
I meant "rewritten to use two if statements" instead of "dropped". I
think "replaced" or "refactored" was the word I wanted.
IMHO that would be a significant uglification, not worthy to address an
issue that could be solved with the patch proposed here.
@Tariq: are you ok with this patch?
Thanks,
Paolo