Re: [akpm-mm:mm-unstable 36/283] include/uapi/linux/const.h:20:25: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '17179869184' to '0'

Geert Uytterhoeven <[email protected]>
Newsgroups gmane.linux.ports.sh.devel,gmane.linux.kernel.mm
Message-ID <CAMuHMdXpUat2cTH_YBqQNUQY4=Y3em38GDY5vr+HYhd_qk3qcA@mail.gmail.com>
Hi Andrew,

On Thu, 13 Nov 2025 at 19:08, Andrew Morton <[email protected]> wrote:
> On Thu, 13 Nov 2025 20:26:42 +0800 kernel test robot <[email protected]> wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> > head:   f58b4cb6b0c11172a25c2ade23477f55596d7138
> > commit: 2f6ff71280ffddb27ad7174d24f573e2683870cd [36/283] mm: fix MAX_FOLIO_ORDER on powerpc configs with hugetlb
> > config: sh-randconfig-002-20251113 (https://download.01.org/0day-ci/archive/20251113/[email protected]/config)
> > compiler: sh4-linux-gcc (GCC) 11.5.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251113/[email protected]/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <[email protected]>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> >
> > All warnings (new ones prefixed by >>):
> >
> >    In file included from arch/sh/include/asm/bug.h:112,
> >                     from include/linux/bug.h:5,
> >                     from include/linux/mmdebug.h:5,
> >                     from include/linux/mm.h:6,
> >                     from include/linux/migrate.h:5,
> >                     from mm/migrate.c:16:
> >    mm/internal.h: In function 'folio_set_order':
> > >> include/uapi/linux/const.h:20:25: warning: conversion from 'long long unsigned int' to 'long unsigned int' changes value from '17179869184' to '0' [-Woverflow]
> >       20 | #define __AC(X,Y)       (X##Y)
> >          |                         ^~~~~~
> >    include/asm-generic/bug.h:111:32: note: in definition of macro 'WARN_ON_ONCE'
> >      111 |         int __ret_warn_on = !!(condition);                      \
> >          |                                ^~~~~~~~~
> >    mm/internal.h:758:9: note: in expansion of macro 'VM_WARN_ON_ONCE'
> >      758 |         VM_WARN_ON_ONCE(order > MAX_FOLIO_ORDER);
> >          |         ^~~~~~~~~~~~~~~
> >    include/uapi/linux/const.h:21:25: note: in expansion of macro '__AC'
> >       21 | #define _AC(X,Y)        __AC(X,Y)
> >          |                         ^~~~
> >    include/linux/sizes.h:56:41: note: in expansion of macro '_AC'
> >       56 | #define SZ_16G                          _AC(0x400000000, ULL)
> >          |                                         ^~~
> >    include/linux/mm.h:2095:43: note: in expansion of macro 'SZ_16G'
> >     2095 | #define MAX_FOLIO_ORDER         get_order(SZ_16G)
> >          |                                           ^~~~~~
> >    mm/internal.h:758:33: note: in expansion of macro 'MAX_FOLIO_ORDER'
> >      758 |         VM_WARN_ON_ONCE(order > MAX_FOLIO_ORDER);
> >          |                                 ^~~~~~~~~~~~~~~
>
> Oh gee.
>
> Here's the patch: https://lkml.kernel.org/r/[email protected]
>
> I'll append a copy below.
>
> For a start, you have found an sh config which sets neither
> CONFIG_32BIT not CONFIG_64BIT.  Should that even be possible?

Apparently yes...

arch/sh/mm/Kconfig:

    config 29BIT
            def_bool !32BIT
            select UNCACHED_MAPPING

    config 32BIT
            bool
            default !MMU

    config PMB
            bool "Support 32-bit physical addressing through PMB"
            depends on MMU && CPU_SH4A && !CPU_SH4AL_DSP
            select 32BIT
            select UNCACHED_MAPPING
            help
              If you say Y here, physical addressing will be extended to
              32-bits through the SH-4A PMB. If this is not set, legacy
              29-bit physical addressing will be used.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.