Re: [PATCH v4 1/9] sched: Add a generic function to return the preemption string.

From: Ingo Molnar
Date: Sun Mar 16 2025 - 07:16:01 EST



* Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:

> +const char *preempt_modes[] = {
> + "none", "voluntary", "full", "lazy", NULL,
> +};

> + /* Count entries in NULL terminated preempt_modes */
> + for (j = 0; preempt_modes[j]; j++)
> + ;

I'm pretty sure the build-time ARRAY_SIZE() primitive is superior here. ;-)

Thanks,

Ingo