On Wed, 22 May 2019 18:55:11 -0700 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > > + return (unsigned long)PAGE_SIZE << compound_order(page); > > > + } > > > > Also, I suspect the cast here is unneeded. Architectures used to > > differe in the type of PAGE_SIZE but please tell me that's been fixed > > for a lomng time... > > It's an unsigned int for most, if not all architectures. For, eg, > PowerPC, a PUD page is larger than 4GB. So let's just include the cast > and not have to worry about undefined semantics screwing us over. I think you'll find that PAGE_SIZE is unsigned long on all architectures.