Re: [PATCH] sched: remove unused cpumask variable in mm_cid_get()

From: Peter Zijlstra

Date: Tue Oct 14 2025 - 06:31:24 EST


On Thu, Oct 09, 2025 at 07:48:18PM +0000, Kriish Sharma wrote:
> The variable 'cpumask' in mm_cid_get() was assigned but never used,
> causing the following build error with -Werror:
>
> kernel/sched/sched.h: In function ‘mm_cid_get’:
> kernel/sched/sched.h:3743:25: error: variable ‘cpumask’ set but not used [-Werror=unused-but-set-variable]
> 3743 | struct cpumask *cpumask;
> | ^~~~~~~
>
> Removing the unused variable allows the kernel to compile without errors.

How come I don't see build errors myself?

Anyway, Thomas is in the process or rewriting all this, I'm not inclined
to bother with this unless the build robots actually complain.

Also, you're missing a Fixes tag or something, some commit must've
caused this.

> Signed-off-by: Kriish Sharma <kriish.sharma2006@xxxxxxxxx>
> ---
> kernel/sched/sched.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 1f5d07067f60..361f9101cef9 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h
> @@ -3740,11 +3740,9 @@ static inline int mm_cid_get(struct rq *rq, struct task_struct *t,
> struct mm_struct *mm)
> {
> struct mm_cid __percpu *pcpu_cid = mm->pcpu_cid;
> - struct cpumask *cpumask;
> int cid;
>
> lockdep_assert_rq_held(rq);
> - cpumask = mm_cidmask(mm);
> cid = __this_cpu_read(pcpu_cid->cid);
> if (mm_cid_is_valid(cid)) {
> mm_cid_snapshot_time(rq, mm);
> --
> 2.34.1
>