All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Rosser <jonathan.rosser-gjMux1o1B1/QXOPxS62xeg@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] librdmacm: fix compiler warning of void* arithmetic
Date: Mon, 25 Oct 2010 10:52:44 +0100	[thread overview]
Message-ID: <ia3k1c$930$2@dough.gmane.org> (raw)
In-Reply-To: <i9rnbn$f9o$1@dough.gmane.org>

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

  parent reply	other threads:[~2010-10-25  9:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-11-01 17:04   ` Hefty, Sean

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='ia3k1c$930$2@dough.gmane.org' \
    --to=jonathan.rosser-gjmux1o1b1/qxopxs62xeg@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 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.