net/mlx5: Remove redundant memset after kvzalloc
Subsystems (4)
PATCH 1/1 net/mlx5: Remove redundant memset after kvzalloc
kvzalloc() returns zeroed memory, so the memset after the allocation in mlx5e_post_meter_create_mtu_table() and macsec_fs_tx_create() is redundant.
So remove the memset.
No functional change.
--- drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c | 1 - drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c +0 -1
@@ -310,7 +310,6 @@ mlx5e_post_meter_create_mtu_table(struct mlx5e_priv *priv, }/* create miss group */ -memset (flow_group_in,0 , inlen);MLX5_SET (create_flow_group_in, flow_group_in, start_flow_index,1 );MLX5_SET (create_flow_group_in, flow_group_in, end_flow_index,1 ); fg =mlx5_create_flow_group (table->ft, flow_group_in);
drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c +0 -1
@@ -476,7 +476,6 @@ static int macsec_fs_tx_create(struct mlx5_macsec_fs *macsec_fs) tx_tables->ft_check = flow_table;/* Tx check table Default miss group/rule */ -memset (flow_group_in,0 , inlen);MLX5_SET (create_flow_group_in, flow_group_in, start_flow_index, flow_table->max_fte -1 );MLX5_SET (create_flow_group_in, flow_group_in, end_flow_index, flow_table->max_fte -1 ); flow_group =mlx5_create_flow_group (tx_tables->ft_check, flow_group_in);
base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
Signature · 1 line
2.43.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 9 lines
kvzalloc()returns zeroed memory, so the memset after the allocation inmlx5e_post_meter_create_mtu_table()andmacsec_fs_tx_create()is redundant.So remove the memset.
No functional change.
Signed-off-by Sang-Heon Jeon <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · Sang-Heon Jeon
kvzalloc()returns zeroed memory, so the memset after the allocation inmlx5e_post_meter_create_mtu_table()andmacsec_fs_tx_create()is redundant.So remove the memset.
No functional change.
Signed-off-by Sang-Heon Jeon <[email protected]>
Hi Sang-Heon,
I'm not sure if the value this cleanup brings is worth the churn. But I do believe it is correct.
Quoted 7 lines · Simon Horman
Quoted 6 lines · Sang-Heon Jeon
kvzalloc()returns zeroed memory, so the memset after the allocation inmlx5e_post_meter_create_mtu_table()andmacsec_fs_tx_create()is redundant.So remove the memset.
Quoted 7 lines
Quoted 3 lines
No functional change.
Signed-off-by Sang-Heon Jeon <[email protected]>Hi Sang-Heon,
I'm not sure if the value this cleanup brings is worth the churn.
Exactly!
Quoted 3 lines
But I do believe it is correct.
Reviewed-by Simon Horman <[email protected]>
Anyway,
Hi, Simon and Tariq
2026년 10월 20일 (화) 오전 3:44, Tariq Toukan <[email protected]>님이 작성:
Quoted 13 lines · Simon Horman
Quoted 9 lines · Sang-Heon Jeon
Quoted 8 lines
kvzalloc()returns zeroed memory, so the memset after the allocation inmlx5e_post_meter_create_mtu_table()andmacsec_fs_tx_create()is redundant.So remove the memset.
No functional change.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Sang-Heon Jeon <[email protected]>Hi Sang-Heon,
I'm not sure if the value this cleanup brings is worth the churn.
Exactly!
Fair enough. I do believe this patch can be helpful to future readers. But I fully respect the community and other people's resources. So just let me know if you don't want to see this kind of patch later. I'll keep that in my mind.
Quoted 7 lines
Quoted 3 lines
But I do believe it is correct.
Reviewed-by Simon Horman <[email protected]>Anyway,
Reviewed-by Tariq Toukan <[email protected]>
Thanks for the review :)
Best regards
Sang-Heon Jeon