lkml.org 
[lkml]   [2019]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 15/27] net: use zeroing allocator rather than allocator followed by memset zero
Date


On 6/28/2019 5:48 AM, Fuqian Huang wrote:
> Replace allocator followed by memset with 0 with zeroing allocator.
>
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> ---

..


> --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
> @@ -1062,7 +1062,7 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn,
> struct mlx4_qp_context *context;
> int err = 0;
>
> - context = kmalloc(sizeof(*context), GFP_KERNEL);
> + context = kzalloc(sizeof(*context), GFP_KERNEL);
> if (!context)
> return -ENOMEM;
>
> @@ -1073,7 +1073,6 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, int qpn,
> }
> qp->event = mlx4_en_sqp_event;
>
> - memset(context, 0, sizeof(*context));
> mlx4_en_fill_qp_context(priv, ring->actual_size, ring->stride, 0, 0,
> qpn, ring->cqn, -1, context);
> context->db_rec_addr = cpu_to_be64(ring->wqres.db.dma);
>


For the mlx4 part:
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>

Tariq
\
 
 \ /
  Last update: 2019-06-30 14:20    [W:0.051 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site