net/mlx5e: Fix incompatible casting
authorAya Levin <ayal@nvidia.com>
Tue, 25 May 2021 12:35:25 +0000 (15:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:39:18 +0000 (13:39 +0200)
commitc1ea8c0e71ead1efaaba33e241c1e7d35e9cbf51
tree1d40ddc5c1f26077dcaa58ab2b3851d484ece2f1
parentf1d4184f128dede82a59a841658ed40d4e6d3aa2
net/mlx5e: Fix incompatible casting

[ Upstream commit d8ec92005f806dfa7524e9171eca707c0bb1267e ]

Device supports setting of a single fec mode at a time, enforce this
by bitmap_weight == 1. Input from fec command is in u32, avoid cast to
unsigned long and use bitmap_from_arr32 to populate bitmap safely.

Fixes: 4bd9d5070b92 ("net/mlx5e: Enforce setting of a single FEC mode")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c