On Thu, Feb 22, 2018 at 09:43:17PM +0100, Mathieu Malaterre wrote: > I am trying to rewrite the following function-like macro (1): > > #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) > > To prevent the following warning: > > ./arch/powerpc/include/asm/page.h:129:32: error: comparison of > unsigned expression >= 0 is always true [-Werror=type-limits] > #define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr) If everything here is unsigned and the same type, this is #define pfn_valid(pfn) \ (((pfn) - ARCH_PFN_OFFSET) < (max_mapnr - ARCH_PFN_OFFSET)) (if not, add casts to taste). Segher