public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche-Sjgp3cTcYWE@public.gmane.org>
To: "yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org"
	<yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org"
	<hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	"sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH rdma-core] librdmacm: Remove unneeded condition
Date: Thu, 2 Nov 2017 15:10:27 +0000	[thread overview]
Message-ID: <1509635426.2484.9.camel@wdc.com> (raw)
In-Reply-To: <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote:
> The check makes no difference - remove it.
> 
> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
> ---
>  librdmacm/cma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index 7aaf45f2..6eebe71b 100644
> --- a/librdmacm/cma.c
> +++ b/librdmacm/cma.c
> @@ -880,8 +880,8 @@ static int rdma_resolve_addr2(struct rdma_cm_id *id, struct sockaddr *src_addr,
>  	CMA_INIT_CMD(&cmd, sizeof cmd, RESOLVE_ADDR);
>  	id_priv = container_of(id, struct cma_id_private, id);
>  	cmd.id = id_priv->handle;
> -	if ((cmd.src_size = src_len))
> -		memcpy(&cmd.src_addr, src_addr, src_len);
> +	cmd.src_size = src_len;
> +	memcpy(&cmd.src_addr, src_addr, src_len);
>  	memcpy(&cmd.dst_addr, dst_addr, dst_len);
>  	cmd.dst_size = dst_len;
>  	cmd.timeout_ms = timeout_ms;

Shouldn't the description have been "Passing zero as third argument to
memcpy() is allowed so the if-test is not necessary. Hence leave it out"?

Bart.

  parent reply	other threads:[~2017-11-02 15:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 13:51 [PATCH rdma-core] librdmacm: Remove unneeded condition Yuval Shaia
     [not found] ` <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-11-02 15:10   ` Bart Van Assche [this message]
     [not found]     ` <1509635426.2484.9.camel-Sjgp3cTcYWE@public.gmane.org>
2017-11-02 16:45       ` Jason Gunthorpe
     [not found]         ` <20171102164528.GM18874-uk2M96/98Pc@public.gmane.org>
2017-11-05  7:26           ` Leon Romanovsky
     [not found]             ` <20171105072657.GF31774-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-05  9:30               ` Yuval Shaia
2017-11-05 13:27                 ` Leon Romanovsky
2017-11-02 15:12   ` Leon Romanovsky
     [not found]     ` <20171102151252.GY16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-02 18:03       ` Yuval Shaia

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=1509635426.2484.9.camel@wdc.com \
    --to=bart.vanassche-sjgp3ctcywe@public.gmane.org \
    --cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox