On Fri, Jan 04, 2019 at 08:18:32AM -0600, Shiraz Saleem wrote: > > > + */ > > > +unsigned long ib_umem_find_single_pg_size(struct ib_umem *umem, > > > + unsigned long supported_pgsz, > > > + unsigned long uvirt_addr) > > > +{ > > > + struct scatterlist *sg; > > > + unsigned int pg_bit_sg, min_pg_bit, best_pg_bit; > > > + int i; > > > + > > > + if (!supported_pgsz) > > > + return 0; > > > > Maybe like: > > > > if (WARN_ON(!(BIT_ULL(PAGE_SHIFT) & supported_pgsz))) > > return 0; Actually this is a bit over-reaching, it should be 'driver must support the system page size or smaller' so maybe WARN_ON(support_pgsz & GENMASK(PAGE_SHIFT, 0) == 0) because we can always take large pages and break them down. Jason