mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-03 21:45:08 -04:00
net/mlx5: Remove redundant esw multiport validate function
The function didn't validate the value and doesn't require value validation as it will always be valid true or false values. Signed-off-by: Roi Dayan <roid@nvidia.com> Reviewed-by: Maor Dickman <maord@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
This commit is contained in:
committed by
Saeed Mahameed
parent
20d5e0ef25
commit
c511822fe2
@@ -464,27 +464,6 @@ static int mlx5_devlink_esw_multiport_get(struct devlink *devlink, u32 id,
|
||||
ctx->val.vbool = mlx5_lag_is_mpesw(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mlx5_devlink_esw_multiport_validate(struct devlink *devlink, u32 id,
|
||||
union devlink_param_value val,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mlx5_core_dev *dev = devlink_priv(devlink);
|
||||
|
||||
if (!MLX5_ESWITCH_MANAGER(dev)) {
|
||||
NL_SET_ERR_MSG_MOD(extack, "E-Switch is unsupported");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if (mlx5_eswitch_mode(dev) != MLX5_ESWITCH_OFFLOADS) {
|
||||
NL_SET_ERR_MSG_MOD(extack,
|
||||
"E-Switch must be in switchdev mode");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int mlx5_devlink_eq_depth_validate(struct devlink *devlink, u32 id,
|
||||
@@ -563,7 +542,7 @@ static const struct devlink_param mlx5_devlink_params[] = {
|
||||
BIT(DEVLINK_PARAM_CMODE_RUNTIME),
|
||||
mlx5_devlink_esw_multiport_get,
|
||||
mlx5_devlink_esw_multiport_set,
|
||||
mlx5_devlink_esw_multiport_validate),
|
||||
NULL),
|
||||
#endif
|
||||
DEVLINK_PARAM_GENERIC(IO_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT),
|
||||
NULL, NULL, mlx5_devlink_eq_depth_validate),
|
||||
|
||||
Reference in New Issue
Block a user