Using ERR_CAST() is more reasonable and safer, When it is necessary to convert the type of an error pointer and return it. Signed-off-by: Yan Zhen <yanzhen@xxxxxxxx> --- drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c index 773624bb2c5d..2a0f70987749 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c @@ -130,7 +130,7 @@ static struct mlx5e_ethtool_table *get_flow_table(struct mlx5e_priv *priv, ft_attr.autogroup.max_num_groups = MLX5E_ETHTOOL_NUM_GROUPS; ft = mlx5_create_auto_grouped_flow_table(ns, &ft_attr); if (IS_ERR(ft)) - return (void *)ft; + return ERR_CAST(ft); eth_ft->ft = ft; return eth_ft; -- 2.34.1