Skip to content
  • Stephen Rothwell's avatar
    mm/cma: silence warnings due to max() usage · badbda53
    Stephen Rothwell authored
    pageblock_order can be (at least) an unsigned int or an unsigned long
    depending on the kernel config and architecture, so use max_t(unsigned
    long, ...) when comparing it.
    
    fixes these warnings:
    
    In file included from include/asm-generic/bug.h:13:0,
                     from arch/powerpc/include/asm/bug.h:127,
                     from include/linux/bug.h:4,
                     from include/linux/mmdebug.h:4,
                     from include/linux/mm.h:8,
                     from include/linux/memblock.h:18,
                     from mm/cma.c:28:
    mm/cma.c: In function 'cma_init_reserved_mem':
    include/linux/kernel.h:748:17: warning: comparison of distinct pointer types lacks a cast
      (void) (&_max1 == &_max2);                   ^
    mm/cma.c:186:27: note: in expansion of macro 'max'
      alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order);
                               ^
    mm/cma.c: In function 'cma_declare_contiguous':
    include/linux/kernel.h:748:17: warning: comparison of distinct poin...
    badbda53