]> Gentwo Git Trees - linux/.git/commitdiff
net/mlx5e: Use U8_MAX instead of hard coded magic number
authorGal Pressman <gal@nvidia.com>
Sun, 30 Nov 2025 10:25:33 +0000 (12:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 1 Dec 2025 22:56:27 +0000 (14:56 -0800)
Replace hard coded 255 magic number with U8_MAX (the register field is 8
bits).

Signed-off-by: Gal Pressman <gal@nvidia.com>
Reviewed-by: Nimrod Oren <noren@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1764498334-1327918-4-git-send-email-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c

index 7127442f800315fda48a24aca89289f3b9464ad1..79f9d43b09b3cc2077b346e534810ecd1f272c4c 100644 (file)
@@ -614,8 +614,8 @@ static int mlx5e_dcbnl_ieee_setmaxrate(struct net_device *netdev,
 
        memset(max_bw_value, 0, sizeof(max_bw_value));
        memset(max_bw_unit, 0, sizeof(max_bw_unit));
-       upper_limit_100mbps = 255 * MLX5E_100MB;
-       upper_limit_gbps = 255 * MLX5E_1GB;
+       upper_limit_100mbps = U8_MAX * MLX5E_100MB;
+       upper_limit_gbps = U8_MAX * MLX5E_1GB;
 
        for (i = 0; i <= mlx5_max_tc(mdev); i++) {
                if (!maxrate->tc_maxrate[i]) {