All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Pavel Machek <pavel@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Hans de Goede <hansg@kernel.org>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: trigger: ledtrig-cpu:: enforce NR_CPUS limit in Kconfig
Date: Wed, 25 Jun 2025 10:24:50 +0100	[thread overview]
Message-ID: <20250625092450.GT795775@google.com> (raw)
In-Reply-To: <20250620110820.3364008-1-arnd@kernel.org>

On Fri, 20 Jun 2025, Arnd Bergmann wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> This driver fails build testing with larger values of CONFIG_NR_CPUS:
> 
> drivers/leds/trigger/ledtrig-cpu.c: In function ‘ledtrig_cpu_init’:
> include/linux/compiler_types.h:571:45: error: call to ‘__compiletime_assert_726’ declared with attribute error: BUILD_BUG_ON failed: CONFIG_NR_CPUS > 9999
> drivers/leds/trigger/ledtrig-cpu.c:137:9: note: in expansion of macro ‘BUILD_BUG_ON’
>   137 |         BUILD_BUG_ON(CONFIG_NR_CPUS > 9999);
> 
> Enforce this limit in Kconfig instead to avoid the build failure.

I have so many questions!

- This number seems arbitrary - what is the limiting factor?
  - Character size for printing?
- What platform did you test this on to blow through that number?
- What if we really do want 10000+ CPUs?
  - And what will that LED array look like to support them all?
- If we're enforcing here, is the BUILD_BUG_ON() now superfluous?

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/leds/trigger/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
> index c11282a74b5a..e07bd17cfe35 100644
> --- a/drivers/leds/trigger/Kconfig
> +++ b/drivers/leds/trigger/Kconfig
> @@ -65,6 +65,7 @@ config LEDS_TRIGGER_BACKLIGHT
>  config LEDS_TRIGGER_CPU
>  	bool "LED CPU Trigger"
>  	depends on !PREEMPT_RT
> +	depends on NR_CPUS <= 9999
>  	help
>  	  This allows LEDs to be controlled by active CPUs. This shows
>  	  the active CPUs across an array of LEDs so you can see which
> -- 
> 2.39.5
> 

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2025-06-25  9:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 11:08 [PATCH] leds: trigger: ledtrig-cpu:: enforce NR_CPUS limit in Kconfig Arnd Bergmann
2025-06-25  9:24 ` Lee Jones [this message]
2025-06-25 10:24   ` Arnd Bergmann
2025-06-25 10:36     ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250625092450.GT795775@google.com \
    --to=lee@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.