All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Sergey Shtylyov <s.shtylyov@auroraos.dev>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tick/sched: check skew_tick kernel parameter's validity
Date: Wed, 30 Sep 2026 21:36:57 +0200	[thread overview]
Message-ID: <87tsn6h6p2.ffs@fw13> (raw)
In-Reply-To: <d95d424c-77a7-4c59-a7cb-9e547af7461c@auroraos.dev>

On Wed, Sep 30 2026 at 22:01, Sergey Shtylyov wrote:
> On 9/29/26 11:01 PM, Thomas Gleixner wrote:
> [...]>> In skew_tick(), the result of get_option() call is ignored, so even if a
>>> value of the skew_tick kernel parameter was not specified (or specified
>>> as a list or range), the kernel won't complain. Add the missing check...
>>>
>>> Found by Linux Verification Center (linuxtesting.org) with the Svace static
>>> analysis tool.
>>>
>>> Signed-off-by: Sergey Shtylyov <s.shtylyov@auroraos.dev>
>>>
>>> ---
>>> The patch is against the timers/nohz branch of the tip.git repo...
>>>
>>>  kernel/time/tick-sched.c | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
>>> index c1ee0b256445..34ceccdd49b5 100644
>>> --- a/kernel/time/tick-sched.c
>>> +++ b/kernel/time/tick-sched.c
>>> @@ -1483,7 +1483,8 @@ static int sched_skew_tick;
>>>
>>>  static int __init skew_tick(char *str)
>>>  {
>>> -     get_option(&str, &sched_skew_tick);
>>> +     if (get_option(&str, &sched_skew_tick) != 1)
>>> +             return -EINVAL;
>>>
>>>       return 0;
>>>  }
>> 
>> sched_skew_tick should be converted to bool and this function should
>> simply do:
>> 
>>        return kstrtobool(str, &sched_skew_tick);
>
>    Thanks for your comment!
>    OK, I'll do that (and add the Suggested-by: tag, of/c)...
>
>> And to make it complete, sched_skew_tick should be annotated with
>> ro_after_init.
>
>    I guess you meant __ro_after_init? Would it then be OK adding it
> in the same patch?

As you change the data type of the variable anyway that's fine. Just
mention it in the changelog.

Thanks,

        tglx

  reply	other threads:[~2026-09-30 19:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 20:25 [PATCH] tick/sched: check skew_tick kernel parameter's validity Sergey Shtylyov
2026-09-01 12:55 ` Frederic Weisbecker
2026-09-01 17:43   ` Sergey Shtylyov
2026-09-29 20:01 ` Thomas Gleixner
2026-09-30 19:01   ` Sergey Shtylyov
2026-09-30 19:36     ` Thomas Gleixner [this message]
2026-09-30 19:49       ` Sergey Shtylyov
2026-09-30 20:04     ` Sergey Shtylyov
2026-09-30 22:20       ` Thomas Gleixner

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=87tsn6h6p2.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=anna-maria@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=s.shtylyov@auroraos.dev \
    /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.