After memory optimization, the organization of some resources are changed from pointer based LIST to the index based ILIST. A lot of code parts are touched due to such change. Some static code checking and analysis tool will complain and raise a false warning on the uninitialized value using. E.g. in the port action registering function, the stack variable will be used as the right value with some uninitialized field to initialize variable allocated from heap. But indeed, it is not an error because all the fileds set with the uninitialized value will be overwritten in the following code part and the macros. All the fields will be used as the left value explicitly. It makes no sense to clear the stack variable to 0 in this case, and the extra memset will introduce some cycles overhead. It just needs to ignore the false warning from the tool, if any.
Fixes: f3faf9e ("net/mlx5: convert port id action to indexed") Cc: suanmi...@mellanox.com Signed-off-by: Bing Zhao <bi...@mellanox.com> Reviewed-by: Matan Azrad <ma...@mellanox.com> Reviewed-by: Suanming Mou <suanmi...@mellanox.com> Acked-by: Viacheslav Ovsiienko <viachesl...@mellanox.com> --- drivers/net/mlx5/mlx5_flow_dv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 45fa60c..7fe4438 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -7832,7 +7832,6 @@ struct field_modify_info modify_tcp[] = { if (flow_dv_translate_action_port_id(dev, action, &port_id, error)) return -rte_errno; - memset(&port_id_resource, 0, sizeof(port_id_resource)); port_id_resource.port_id = port_id; MLX5_ASSERT(!handle->rix_port_id_action); if (flow_dv_port_id_action_resource_register -- 1.8.3.1