All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia@oracle.com>
To: Himanshu Jha <himanshujha199640@gmail.com>
Cc: selvin.xavier@broadcom.com, devesh.sharma@broadcom.com,
	somnath.kotur@broadcom.com, dledford@redhat.com,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset
Date: Sun, 27 Aug 2017 11:16:58 +0300	[thread overview]
Message-ID: <20170827081657.GA5681@yuvallap> (raw)
In-Reply-To: <1503677462-24238-1-git-send-email-himanshujha199640@gmail.com>

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

  reply	other threads:[~2017-08-27  8:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 16:11 [PATCH] RDMA/bnxt_re: remove unnecessary call to memset Himanshu Jha
2017-08-27  8:16 ` Yuval Shaia [this message]
     [not found] ` <1503677462-24238-1-git-send-email-himanshujha199640-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-28 23:17   ` Doug Ledford
2017-08-28 23:17     ` Doug Ledford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170827081657.GA5681@yuvallap \
    --to=yuval.shaia@oracle.com \
    --cc=devesh.sharma@broadcom.com \
    --cc=dledford@redhat.com \
    --cc=himanshujha199640@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=selvin.xavier@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.