mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@mellanox.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Jason Gunthorpe <jgg@mellanox.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	"Michael J. Ruhl" <michael.j.ruhl@intel.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ib_umem: fix type mismatch
Date: Sun, 8 Sep 2019 08:10:26 +0000	[thread overview]
Message-ID: <20190908081022.GD26697@unreal> (raw)
In-Reply-To: <20190906154243.2282560-1-arnd@arndb.de>

On Fri, Sep 06, 2019 at 05:42:37PM +0200, Arnd Bergmann wrote:
> On some 32-bit architectures, size_t is defined as 'int' rather
> than 'long', causing a harmless warning:
>
> drivers/infiniband/core/umem_odp.c:220:7: error: comparison of distinct pointer types ('typeof (umem_odp->umem.address) *' (aka 'unsigned long *') and 'typeof (umem_odp->umem.length) *' (aka 'unsigned int *')) [-Werror,-Wcompare-distinct-pointer-types]
>                 if (check_add_overflow(umem_odp->umem.address,
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/overflow.h:59:15: note: expanded from macro 'check_add_overflow'
>         (void) (&__a == &__b);                  \
>                 ~~~~ ^  ~~~~
>
> As size_t is always the same length as unsigned long in all supported
> architectures, change the structure definition to use the unsigned long
> type for both.
>
> Fixes: 204e3e5630c5 ("RDMA/odp: Check for overflow when computing the umem_odp end")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  include/rdma/ib_umem.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Hi Arnd,

I had slightly different fix in my submission queue, which I think is
better because it leaves length to be size_t.

https://lore.kernel.org/linux-rdma/20190908080726.30017-1-leon@kernel.org/T/#u

Thanks

  reply	other threads:[~2019-09-08  8:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 15:42 Arnd Bergmann
2019-09-08  8:10 ` Leon Romanovsky [this message]
2019-09-08  8:24   ` Arnd Bergmann

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=20190908081022.GD26697@unreal \
    --to=leonro@mellanox.com \
    --cc=arnd@arndb.de \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michael.j.ruhl@intel.com \
    --cc=shiraz.saleem@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®