Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Doug Ledford <dledford@redhat.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/umem: Silence build warning on i386 architecture
Date: Mon, 11 Jan 2021 08:41:24 +0200	[thread overview]
Message-ID: <20210111064124.GK31158@unreal> (raw)
In-Reply-To: <20210108202831.GA1042005@nvidia.com>

On Fri, Jan 08, 2021 at 04:28:31PM -0400, Jason Gunthorpe wrote:
> On Wed, Jan 06, 2021 at 02:20:47PM +0200, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> >
> > Sacrifice one page in order to silence compilation failure on i386
> > architecture.
> >
> > drivers/infiniband/core/umem.c:205 __ib_umem_get() warn: impossible
> > 			condition '(npages > (~0)) => (0-u32max > u32max)'
>
> I think I prefer to just leave this warning on 32 bit builds.. 32 bit
> inherently can't have this overflow so yes the condition should be
> impossible
>
> Using >= is just confusing
>
> If you really want to fix it then npages and every place that touches
> it should be made size_t or unsigned long.
>
> This includes __sg_alloc_table_from_pages, which doesn't look so bad
> actually..

npages is used as "unsigned long" in all places: pin_user_pages_fast()
and internally in __sg_alloc_table_from_pages().

I can't say if it is going to be not bad as you said.

However, let's add rewrite of this patch to my backlog.

Thanks

>
> Jason

      reply	other threads:[~2021-01-11  6:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 12:20 [PATCH rdma-next] RDMA/umem: Silence build warning on i386 architecture Leon Romanovsky
2021-01-08 20:28 ` Jason Gunthorpe
2021-01-11  6:41   ` Leon Romanovsky [this message]

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=20210111064124.GK31158@unreal \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.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