Re: [PATCH rdma-next] RDMA/umem: Silence build warning on i386 architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> >
> > 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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux