public inbox for sched-ext@lists.linux.dev
 help / color / mirror / Atom feed
From: Andrea Righi <arighi@nvidia.com>
To: Cheng-Yang Chou <yphbchou0911@gmail.com>
Cc: sched-ext@lists.linux.dev, tj@kernel.org, void@manifault.com,
	changwoo@igalia.com, jserv@ccns.ncku.edu.tw
Subject: Re: [PATCH] tools/sched_ext: Fix get_prandom_u64() prototype
Date: Sun, 8 Mar 2026 15:01:59 +0100	[thread overview]
Message-ID: <aa2BV-YMfe_NHFwV@gpd4> (raw)
In-Reply-To: <20260308130638.719915-1-yphbchou0911@gmail.com>

Hi,

On Sun, Mar 08, 2026 at 09:06:38PM +0800, Cheng-Yang Chou wrote:
> In C99 (Sec 6.7.5.3), an empty parameter list in a declaration leaves
> the parameter types unspecified (K&R style), not explicitly zero.
> Consequently, the compiler would silently accept arbitrary arguments
> passed to the function.
> 
> Declare the function with (void) to form a proper prototype asserting
> it takes no arguments.
> 
> Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>

I understand the motivation, but changes like this don't fix real issues or
provide any measurable benefit. Patches consume maintainer and reviewer
bandwidth, so it's usually best to focus on changes that fix real bugs or
provide clear improvements.

If you encounter a real issue or can show a measurable improvement (with
traces or numbers), patches addressing that would be much more useful.

Thanks,
-Andrea

> ---
>  tools/sched_ext/include/scx/common.bpf.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/tools/sched_ext/include/scx/common.bpf.h b/tools/sched_ext/include/scx/common.bpf.h
> index a63a98a96b86..99b1a94097e7 100644
> --- a/tools/sched_ext/include/scx/common.bpf.h
> +++ b/tools/sched_ext/include/scx/common.bpf.h
> @@ -621,7 +621,6 @@ static inline bool time_in_range_open(u64 a, u64 b, u64 c)
>  	return time_after_eq(a, b) && time_before(a, c);
>  }
>  
> -
>  /*
>   * Other helpers
>   */
> @@ -870,11 +869,10 @@ static inline u64 scale_by_task_weight_inverse(const struct task_struct *p, u64
>  	return value * 100 / p->scx.weight;
>  }
>  
> -
>  /*
>   * Get a random u64 from the kernel's pseudo-random generator.
>   */
> -static inline u64 get_prandom_u64()
> +static inline u64 get_prandom_u64(void)
>  {
>  	return ((u64)bpf_get_prandom_u32() << 32) | bpf_get_prandom_u32();
>  }
> -- 
> 2.48.1
> 

  reply	other threads:[~2026-03-08 14:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 13:06 [PATCH] tools/sched_ext: Fix get_prandom_u64() prototype Cheng-Yang Chou
2026-03-08 14:01 ` Andrea Righi [this message]
2026-03-08 14:41   ` Cheng-Yang Chou

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=aa2BV-YMfe_NHFwV@gpd4 \
    --to=arighi@nvidia.com \
    --cc=changwoo@igalia.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=sched-ext@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=void@manifault.com \
    --cc=yphbchou0911@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox