net/mlx5: Use ERR_CAST() instead of coding it