Commit 53f7a771 authored by Gal Pressman's avatar Gal Pressman Committed by Jakub Kicinski
Browse files

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: default avatarGal Pressman <gal@nvidia.com>
Reviewed-by: default avatarNimrod Oren <noren@nvidia.com>
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1764498334-1327918-4-git-send-email-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e1098bb0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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]) {