* [PATCH rdma-core] librdmacm: Remove unneeded condition
@ 2017-11-02 13:51 Yuval Shaia
[not found] ` <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Yuval Shaia @ 2017-11-02 13:51 UTC (permalink / raw)
To: sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: Yuval Shaia
The check makes no difference - remove it.
Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
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;
--
2.13.6
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [not found] ` <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> @ 2017-11-02 15:10 ` Bart Van Assche [not found] ` <1509635426.2484.9.camel-Sjgp3cTcYWE@public.gmane.org> 2017-11-02 15:12 ` Leon Romanovsky 1 sibling, 1 reply; 8+ messages in thread From: Bart Van Assche @ 2017-11-02 15:10 UTC (permalink / raw) To: yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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. ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <1509635426.2484.9.camel-Sjgp3cTcYWE@public.gmane.org>]
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [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> 0 siblings, 1 reply; 8+ messages in thread From: Jason Gunthorpe @ 2017-11-02 16:45 UTC (permalink / raw) To: Bart Van Assche Cc: yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org On Thu, Nov 02, 2017 at 03:10:27PM +0000, Bart Van Assche wrote: > On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote: > > The check makes no difference - remove it. > > 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"? +1 Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20171102164528.GM18874-uk2M96/98Pc@public.gmane.org>]
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [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> 0 siblings, 1 reply; 8+ messages in thread From: Leon Romanovsky @ 2017-11-05 7:26 UTC (permalink / raw) To: Jason Gunthorpe Cc: Bart Van Assche, yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 657 bytes --] On Thu, Nov 02, 2017 at 10:45:28AM -0600, Jason Gunthorpe wrote: > On Thu, Nov 02, 2017 at 03:10:27PM +0000, Bart Van Assche wrote: > > On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote: > > > The check makes no difference - remove it. > > > > 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"? > > +1 Yuval ? Thanks > > Jason > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20171105072657.GF31774-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [not found] ` <20171105072657.GF31774-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-11-05 9:30 ` Yuval Shaia 2017-11-05 13:27 ` Leon Romanovsky 0 siblings, 1 reply; 8+ messages in thread From: Yuval Shaia @ 2017-11-05 9:30 UTC (permalink / raw) To: Leon Romanovsky Cc: Jason Gunthorpe, Bart Van Assche, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org On Sun, Nov 05, 2017 at 09:26:58AM +0200, Leon Romanovsky wrote: > On Thu, Nov 02, 2017 at 10:45:28AM -0600, Jason Gunthorpe wrote: > > On Thu, Nov 02, 2017 at 03:10:27PM +0000, Bart Van Assche wrote: > > > On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote: > > > > The check makes no difference - remove it. > > > > > > 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"? > > > > +1 > > Yuval ? Thanks Leon, Just post new pull request with the revised commit message. If still v1 is needed here for review then i'll post it. > > Thanks > > > > > Jason > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition 2017-11-05 9:30 ` Yuval Shaia @ 2017-11-05 13:27 ` Leon Romanovsky 0 siblings, 0 replies; 8+ messages in thread From: Leon Romanovsky @ 2017-11-05 13:27 UTC (permalink / raw) To: Yuval Shaia Cc: Jason Gunthorpe, Bart Van Assche, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org, sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org [-- Attachment #1: Type: text/plain, Size: 1025 bytes --] On Sun, Nov 05, 2017 at 11:30:15AM +0200, Yuval Shaia wrote: > On Sun, Nov 05, 2017 at 09:26:58AM +0200, Leon Romanovsky wrote: > > On Thu, Nov 02, 2017 at 10:45:28AM -0600, Jason Gunthorpe wrote: > > > On Thu, Nov 02, 2017 at 03:10:27PM +0000, Bart Van Assche wrote: > > > > On Thu, 2017-11-02 at 15:51 +0200, Yuval Shaia wrote: > > > > > The check makes no difference - remove it. > > > > > > > > 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"? > > > > > > +1 > > > > Yuval ? > > Thanks Leon, > Just post new pull request with the revised commit message. > If still v1 is needed here for review then i'll post it. Thanks, applied. > > > > > Thanks > > > > > > > > Jason > > > -- > > > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > > More majordomo info at http://vger.kernel.org/majordomo-info.html > > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [not found] ` <20171102135134.5728-1-yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> 2017-11-02 15:10 ` Bart Van Assche @ 2017-11-02 15:12 ` Leon Romanovsky [not found] ` <20171102151252.GY16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> 1 sibling, 1 reply; 8+ messages in thread From: Leon Romanovsky @ 2017-11-02 15:12 UTC (permalink / raw) To: Yuval Shaia Cc: sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb, linux-rdma-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1187 bytes --] On Thu, Nov 02, 2017 at 03:51:34PM +0200, Yuval Shaia wrote: > The check makes no difference - remove it. > > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> > --- > 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)) Isn't this "=" should be "=="? > - 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; > -- > 2.13.6 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <20171102151252.GY16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>]
* Re: [PATCH rdma-core] librdmacm: Remove unneeded condition [not found] ` <20171102151252.GY16127-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org> @ 2017-11-02 18:03 ` Yuval Shaia 0 siblings, 0 replies; 8+ messages in thread From: Yuval Shaia @ 2017-11-02 18:03 UTC (permalink / raw) To: Leon Romanovsky Cc: sean.hefty-ral2JQCrhuEAvxtiuMwx3w, hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb, linux-rdma-u79uwXL29TY76Z2rM5mHXA On Thu, Nov 02, 2017 at 05:12:52PM +0200, Leon Romanovsky wrote: > On Thu, Nov 02, 2017 at 03:51:34PM +0200, Yuval Shaia wrote: > > The check makes no difference - remove it. > > > > Signed-off-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> > > --- > > 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)) > > Isn't this "=" should be "=="? No chance as cmd was just initialized. > > > - 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; > > -- > > 2.13.6 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-05 13:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
[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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox