Re: [PATCH] m68k: Define NR_CPUS to 1

From: Geert Uytterhoeven

Date: Mon Aug 03 2026 - 04:01:04 EST


Hi Uwe,

Thanks for your patch!

On Fri, 31 Jul 2026 at 11:50, Uwe Kleine-König <ukleinek@xxxxxxxxxx> wrote:
> This fixes a Kconfig warning
>
> fs/erofs/Kconfig:137:warning: range is invalid
>
> which originates from EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS using
> NR_CPUS which up to now didn't exist for ARCH=m68k. All other
> architectures define this symbol, so fix the outlier.

Apart from the Kconfig warning, this also
1. Breaks pressing "ENTER" in "make oldconfig" to apply a sensible
default value, just repeating the question ad infinitum instead
(the default is 16),
2. "make olddefconfig" sets it to literal NR_CPUS, which is invalid, too.

> Fixes: c9b47e6b2311 ("erofs: cap LZMA stream pool size")
> Signed-off-by: Uwe Kleine-König <ukleinek@xxxxxxxxxx>

> --- a/arch/m68k/Kconfig.cpu
> +++ b/arch/m68k/Kconfig.cpu
> @@ -549,6 +549,10 @@ config CACHE_COPYBACK
> endchoice
> endif # HAVE_CACHE_CB
>
> +config NR_CPUS
> + int
> + default "1"

While this does fix the issues on m68k, I don't think this is the
right fix:
- NR_CPUS depends on SMP on most architectures, so you do not get
the "range is invalid" warning on non-SMP, but NR_CPUS is zero.
Hence I managed to reproduce the two issues above (albeit 2 with
CONFIG_EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS=0) with a non-SMP
ARM config.
- Kconfig logic using NR_CPUS typically includes a check for SMP, too.

So I think EROFS_FS_ZIP_LZMA_DEFAULT_MAX_STREAMS should be fixed
instead.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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