[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d749469-4e6f-ab0f-8fc9-4ae19ed08a25@oracle.com>
Date: Wed, 13 Mar 2024 16:02:34 -0400
From: Chris Hyser <chris.hyser@...cle.com>
To: "Joel Fernandes (Google)" <joel@...lfernandes.org>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira
<bristot@...hat.com>,
Valentin Schneider <vschneid@...hat.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling
<morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>
Cc: Suleiman Souhlal <suleiman@...gle.com>,
Youssef Esmat <youssefesmat@...gle.com>,
David Vernet <void@...ifault.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E . McKenney"
<paulmck@...nel.org>,
joseph.salisbury@...onical.com,
Luca Abeni <luca.abeni@...tannapisa.it>,
Tommaso Cucinotta <tommaso.cucinotta@...tannapisa.it>,
Vineeth Pillai <vineeth@...byteword.org>,
Shuah Khan <skhan@...uxfoundation.org>, Phil Auld <pauld@...hat.com>,
llvm@...ts.linux.dev
Subject: Re: [PATCH v2 05/15] sched/debug: Use unsigned long for cpu variable
to prevent cast errors
On 3/12/24 21:24, Joel Fernandes (Google) wrote:
> This avoids compiler errors seen with clang:
>
> In file included from kernel/sched/build_utility.c:72:
> kernel/sched/debug.c:532:47: error: cast to 'void *' from smaller integer
> type 'unsigned int' [-Werror,-Wint-to-void-pointer-cast]
> debugfs_create_file("runtime", 0644, d_cpu, (void *) cpu, &fair_server_runtime_fops);
>
> Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
Reviewed-by: Chris Hyser <chris.hyser@...cle.com>
> ---
> kernel/sched/debug.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
> index c6c0120ff105..2590041696bc 100644
> --- a/kernel/sched/debug.c
> +++ b/kernel/sched/debug.c
> @@ -516,7 +516,7 @@ static struct dentry *debugfs_sched;
> static void debugfs_fair_server_init(void)
> {
> struct dentry *d_fair;
> - unsigned int cpu;
> + unsigned long cpu;
>
> d_fair = debugfs_create_dir("fair_server", debugfs_sched);
> if (!d_fair)
> @@ -526,7 +526,7 @@ static void debugfs_fair_server_init(void)
> struct dentry *d_cpu;
> char buf[32];
>
> - snprintf(buf, sizeof(buf), "cpu%d", cpu);
> + snprintf(buf, sizeof(buf), "cpu%lu", cpu);
> d_cpu = debugfs_create_dir(buf, d_fair);
>
> debugfs_create_file("runtime", 0644, d_cpu, (void *) cpu, &fair_server_runtime_fops);
Powered by blists - more mailing lists