[PATCH] sched: Remove unused variable in mm_cid_get()

Kevin Brodsky posted 1 patch 3 months, 3 weeks ago
kernel/sched/sched.h | 2 --
1 file changed, 2 deletions(-)
[PATCH] sched: Remove unused variable in mm_cid_get()
Posted by Kevin Brodsky 3 months, 3 weeks ago
The cpumask variable in mm_cid_get() has never been used, remove it.

This fixes a -Wunused-but-set-variable warning when building with
W=1.

Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
---
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
---
 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);

base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
-- 
2.47.0
Re: [PATCH] sched: Remove unused variable in mm_cid_get()
Posted by Christian Loehle 3 months, 2 weeks ago
On 10/17/25 08:30, Kevin Brodsky wrote:
> The cpumask variable in mm_cid_get() has never been used, remove it.
> 
> This fixes a -Wunused-but-set-variable warning when building with
> W=1.
> 
> Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
> ---
> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Juri Lelli <juri.lelli@redhat.com>
> ---
>  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);
> 
> base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787

Andy also posted this:
https://lore.kernel.org/lkml/20251015091935.2977229-1-andriy.shevchenko@linux.intel.com/
Re: [PATCH] sched: Remove unused variable in mm_cid_get()
Posted by Kevin Brodsky 3 months, 2 weeks ago
On 20/10/2025 12:16, Christian Loehle wrote:
> On 10/17/25 08:30, Kevin Brodsky wrote:
>> The cpumask variable in mm_cid_get() has never been used, remove it.
>>
>> This fixes a -Wunused-but-set-variable warning when building with
>> W=1.
>>
>> Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
>> ---
>> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Juri Lelli <juri.lelli@redhat.com>
>> ---
>>  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);
>>
>> base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
> Andy also posted this:
> https://lore.kernel.org/lkml/20251015091935.2977229-1-andriy.shevchenko@linux.intel.com/

Ah I missed it, thanks! Please ignore my patch then (especially since it
misses a Fixes: tag).

- Kevin