* [PATCH] librdmacm: fix compiler warning of void* arithmetic
@ 2010-10-22 10:00 Jonathan Rosser
2010-10-22 10:25 ` Andrea Gozzelino
2010-10-25 9:52 ` Jonathan Rosser
0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Rosser @ 2010-10-22 10:00 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Arithmetic on void* pointers generates a compiler warning, and projects
that include rdma/rdma_verbs.h and compile with -Werror -Wall will fail
to build.
---
include/rdma/rdma_verbs.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/rdma/rdma_verbs.h b/include/rdma/rdma_verbs.h
index d75d906..853ef9b 100644
--- a/include/rdma/rdma_verbs.h
+++ b/include/rdma/rdma_verbs.h
@@ -160,7 +160,7 @@ rdma_post_recv(struct rdma_cm_id *id, void *context,
void *addr,
{
struct ibv_sge sge;
- assert((addr >= mr->addr) && ((addr + length) <= (mr->addr +
mr->length)));
+ assert((addr >= mr->addr) && (((uint8_t*)addr + length) <=
((uint8_t*)mr->addr + mr->length)));
sge.addr = (uint64_t) (uintptr_t) addr;
sge.length = (uint32_t) length;
sge.lkey = mr->lkey;
--
1.7.0.4
--
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] 4+ messages in thread* Re: [PATCH] librdmacm: fix compiler warning of void* arithmetic
2010-10-22 10:00 [PATCH] librdmacm: fix compiler warning of void* arithmetic Jonathan Rosser
@ 2010-10-22 10:25 ` Andrea Gozzelino
2010-10-25 9:52 ` Jonathan Rosser
1 sibling, 0 replies; 4+ messages in thread
From: Andrea Gozzelino @ 2010-10-22 10:25 UTC (permalink / raw)
To: Jonathan Rosser; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Oct 22, 2010 12:00 PM, Jonathan Rosser <jonathan.rosser-gjMux1o1B1/QXOPxS62xeg@public.gmane.org>
wrote:
> Arithmetic on void* pointers generates a compiler warning, and
> projects
> that include rdma/rdma_verbs.h and compile with -Werror -Wall will
> fail
> to build.
> ---
> include/rdma/rdma_verbs.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/rdma/rdma_verbs.h b/include/rdma/rdma_verbs.h
> index d75d906..853ef9b 100644
> --- a/include/rdma/rdma_verbs.h
> +++ b/include/rdma/rdma_verbs.h
> @@ -160,7 +160,7 @@ rdma_post_recv(struct rdma_cm_id *id, void
> *context,
> void *addr,
> {
> struct ibv_sge sge;
>
> - assert((addr >= mr->addr) && ((addr + length) <= (mr->addr +
> mr->length)));
> + assert((addr >= mr->addr) && (((uint8_t*)addr + length) <=
> ((uint8_t*)mr->addr + mr->length)));
> sge.addr = (uint64_t) (uintptr_t) addr;
> sge.length = (uint32_t) length;
> sge.lkey = mr->lkey;
> --
> 1.7.0.4
>
>
>
> --
> 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
>
Hi Jonathan,
I have found the same building error. Now it works fine.
Andrea Gozzelino
INFN - Laboratori Nazionali di Legnaro (LNL)
Viale dell'Universita' 2 -I-35020 - Legnaro (PD)- ITALIA
Office: E-101
Tel: +39 049 8068346
Fax: +39 049 641925
Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org
Cell: +39 3488245552
--
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] 4+ messages in thread* Re: [PATCH] librdmacm: fix compiler warning of void* arithmetic
2010-10-22 10:00 [PATCH] librdmacm: fix compiler warning of void* arithmetic Jonathan Rosser
2010-10-22 10:25 ` Andrea Gozzelino
@ 2010-10-25 9:52 ` Jonathan Rosser
2010-11-01 17:04 ` Hefty, Sean
1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Rosser @ 2010-10-25 9:52 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Arithmetic on void* pointers generates a compiler warning, and projects
that include rdma/rdma_verbs.h and compile with -Werror -Wall will fail
to build.
Signed-off-by: Jonathan Rosser <jrosser-gjMux1o1B1/QXOPxS62xeg@public.gmane.org>
---
include/rdma/rdma_verbs.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/rdma/rdma_verbs.h b/include/rdma/rdma_verbs.h
index d75d906..853ef9b 100644
--- a/include/rdma/rdma_verbs.h
+++ b/include/rdma/rdma_verbs.h
@@ -160,7 +160,7 @@ rdma_post_recv(struct rdma_cm_id *id, void *context,
void *addr,
{
struct ibv_sge sge;
- assert((addr >= mr->addr) && ((addr + length) <= (mr->addr +
mr->length)));
+ assert((addr >= mr->addr) && (((uint8_t*)addr + length) <=
((uint8_t*)mr->addr + mr->length)));
sge.addr = (uint64_t) (uintptr_t) addr;
sge.length = (uint32_t) length;
sge.lkey = mr->lkey;
--
1.7.0.4
--
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] 4+ messages in thread
end of thread, other threads:[~2010-11-01 17:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 10:00 [PATCH] librdmacm: fix compiler warning of void* arithmetic Jonathan Rosser
2010-10-22 10:25 ` Andrea Gozzelino
2010-10-25 9:52 ` Jonathan Rosser
2010-11-01 17:04 ` Hefty, Sean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox