[PATCH net-next 3/4] net/mlx5e: Use U8_MAX instead of hard coded magic number

Tariq Toukan posted 4 patches 1 day, 11 hours ago
[PATCH net-next 3/4] net/mlx5e: Use U8_MAX instead of hard coded magic number
Posted by Tariq Toukan 1 day, 11 hours ago
From: Gal Pressman <gal@nvidia.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
index 7127442f8003..79f9d43b09b3 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]) {
-- 
2.31.1