From: Gal Pressman Date: Sun, 30 Nov 2025 10:25:33 +0000 (+0200) Subject: net/mlx5e: Use U8_MAX instead of hard coded magic number X-Git-Tag: v6.19-rc1~170^2~11^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53f7a771285182be7bfba6d59ccdd0d47fc1a097;p=thirdparty%2Fkernel%2Flinux.git net/mlx5e: Use U8_MAX instead of hard coded magic number Replace hard coded 255 magic number with U8_MAX (the register field is 8 bits). Signed-off-by: Gal Pressman Reviewed-by: Nimrod Oren Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/1764498334-1327918-4-git-send-email-tariqt@nvidia.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 7127442f80031..79f9d43b09b3c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c @@ -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]) {