On Thu, May 23, 2019 at 02:33:15PM -0700, Andrew Morton wrote: > 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. arch/openrisc/include/asm/page.h:#define PAGE_SIZE (1 << PAGE_SHIFT) The others are a miscellany of different defines, but I think you're right for every other architecture.