Re: [patch V3 03/12] rseq: Provide static branch for time slice extensions
From: Thomas Gleixner
Date: Wed Oct 29 2025 - 17:12:36 EST
On Wed, Oct 29 2025 at 10:23, Randy Dunlap wrote:
> On 10/29/25 6:22 AM, Thomas Gleixner wrote:
>> +static int __init rseq_slice_cmdline(char *str)
>> +{
>> + bool on;
>> +
>> + if (kstrtobool(str, &on))
>> + return -EINVAL;
>
> The norm for __setup function returns is:
>
> return 0; /* param not handled - will be added to ENV */
> or
> return 1; /* param is handled (anything non-zero) */
>
>
> Anything non-zero means param is handled, so maybe -EINVAL is OK here,
> since return 0 means that the string is added to init's environment.
>
> If the parsing function recognizes the cmdline option string
> (rseq_slice_ext) but the value is invalid, it should pr_error()
> or something like that but still return 1; (IMHO).
> No need to have "rseq_slice_ext=foo" added to init's ENV.
>
> So return -EINVAL is like return 1 in this case.
> IOW it works as needed. :)
Bah. I hate this logic so much and I never will memorize it.