Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720792

Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset

From Yuval Shaia <yuval.shaia@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset
Date 2017-08-27 10:20 +0200
Message-ID <uj0Xv-53K-1@gated-at.bofh.it> (permalink)
References <uipuW-6gP-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Aug 25, 2017 at 09:41:02PM +0530, Himanshu Jha wrote:
> call to memset to assign 0 value immediately after allocating
> memory with kzalloc is unnecesaary as kzalloc allocates the memory
> filled with 0 value.
> 
> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> ---
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index f0e01b3..fa6fbac 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -969,7 +969,6 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah
>  	if (!ah)
>  		return NULL;
>  
> -	memset(ah, 0, sizeof(*ah));
>  	ah->rdev = rdev;
>  	ah->qplib_ah.pd = &pd->qplib_pd;
>  
> @@ -1016,7 +1015,6 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp
>  	if (!qp)
>  		return NULL;
>  
> -	memset(qp, 0, sizeof(*qp));
>  	qp->rdev = rdev;
>  
>  	/* Initialize the shadow QP structure from the QP1 values */
> -- 
> 2.7.4

FWIW

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>

> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] RDMA/bnxt_re: remove unnecessary call to memset Himanshu Jha <himanshujha199640@gmail.com> - 2017-08-25 18:20 +0200
  Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset Yuval Shaia <yuval.shaia@oracle.com> - 2017-08-27 10:20 +0200
  Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset Doug Ledford <dledford@redhat.com> - 2017-08-29 01:20 +0200

csiph-web