On Tue, Aug 20, 2019 at 09:14:58AM +0200, Andreas Schwab wrote: > On Aug 19 2019, "h...@infradead.org" <h...@infradead.org> wrote: > > > This looks a little odd to m and assumes we never pass a size smaller > > than PAGE_SIZE. Whule that is probably true, why not something like: > > > > if (size < PAGE_SIZE && size != -1) > > ITYM size <= PAGE_SIZE. And since size is unsigned it cannot be == -1 > at the same time.
Yes, the <= was obvious, that's what you get for hacking up a demo patch on the plan. And true for the -1. That being said I find the -1 convention rather annoying, a ULONG_MAX in the callers would be a lot more obvious.