public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] kthread: Return the assigned value rather than 0
@ 2025-02-03 16:48 Andy Shevchenko
  2025-02-04  0:45 ` Frederic Weisbecker
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2025-02-03 16:48 UTC (permalink / raw)
  To: Frederic Weisbecker, linux-kernel; +Cc: Andy Shevchenko

Recently introduced kthread_affine_preferred() has a bug that the value
of ret variable set but not used. This breaks the compilation with error
(assume default CONFIG_WERROR=y and `make W=1` to run the build):

kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]

Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 kernel/kthread.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/kthread.c b/kernel/kthread.c
index 4005b13ebd7f..8ab625e996d2 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -889,10 +889,12 @@ int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
 	raw_spin_unlock_irqrestore(&p->pi_lock, flags);
 
 	mutex_unlock(&kthreads_hotplug_lock);
+
+	ret = 0;
 out:
 	free_cpumask_var(affinity);
 
-	return 0;
+	return ret;
 }
 
 /*
-- 
2.43.0.rc1.1336.g36b5255a03ac


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] kthread: Return the assigned value rather than 0
  2025-02-03 16:48 [PATCH v1 1/1] kthread: Return the assigned value rather than 0 Andy Shevchenko
@ 2025-02-04  0:45 ` Frederic Weisbecker
  2025-02-04 14:28   ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Frederic Weisbecker @ 2025-02-04  0:45 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel

Le Mon, Feb 03, 2025 at 06:48:55PM +0200, Andy Shevchenko a écrit :
> Recently introduced kthread_affine_preferred() has a bug that the value
> of ret variable set but not used. This breaks the compilation with error
> (assume default CONFIG_WERROR=y and `make W=1` to run the build):
> 
> kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> 
> Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks but I already have it queued there:

https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?h=kthread/fixes&id=1b0332a42656b798bea867631d739de023633ec6

I'll do a pull request shortly.

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] kthread: Return the assigned value rather than 0
  2025-02-04  0:45 ` Frederic Weisbecker
@ 2025-02-04 14:28   ` Andy Shevchenko
  2025-02-07 14:40     ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2025-02-04 14:28 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-kernel

On Tue, Feb 04, 2025 at 01:45:13AM +0100, Frederic Weisbecker wrote:
> Le Mon, Feb 03, 2025 at 06:48:55PM +0200, Andy Shevchenko a écrit :
> > Recently introduced kthread_affine_preferred() has a bug that the value
> > of ret variable set but not used. This breaks the compilation with error
> > (assume default CONFIG_WERROR=y and `make W=1` to run the build):
> > 
> > kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> > 
> > Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Thanks but I already have it queued there:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?h=kthread/fixes&id=1b0332a42656b798bea867631d739de023633ec6
> 
> I'll do a pull request shortly.

I'm fine with any approach as long as the issue will be fixed rather sooner.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] kthread: Return the assigned value rather than 0
  2025-02-04 14:28   ` Andy Shevchenko
@ 2025-02-07 14:40     ` Andy Shevchenko
  2025-02-07 18:32       ` Frederic Weisbecker
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2025-02-07 14:40 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-kernel

On Tue, Feb 04, 2025 at 04:28:37PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 04, 2025 at 01:45:13AM +0100, Frederic Weisbecker wrote:
> > Le Mon, Feb 03, 2025 at 06:48:55PM +0200, Andy Shevchenko a écrit :
> > > Recently introduced kthread_affine_preferred() has a bug that the value
> > > of ret variable set but not used. This breaks the compilation with error
> > > (assume default CONFIG_WERROR=y and `make W=1` to run the build):
> > > 
> > > kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> > > 
> > > Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > 
> > Thanks but I already have it queued there:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?h=kthread/fixes&id=1b0332a42656b798bea867631d739de023633ec6
> > 
> > I'll do a pull request shortly.
> 
> I'm fine with any approach as long as the issue will be fixed rather sooner.

Any news? As of today no appearance of the (alternative) fix either in upstream,
or in Linux Next. What's the plan, please?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] kthread: Return the assigned value rather than 0
  2025-02-07 14:40     ` Andy Shevchenko
@ 2025-02-07 18:32       ` Frederic Weisbecker
  2025-02-07 19:02         ` Andy Shevchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Frederic Weisbecker @ 2025-02-07 18:32 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel

Hi Andy,

Le Fri, Feb 07, 2025 at 04:40:14PM +0200, Andy Shevchenko a écrit :
> On Tue, Feb 04, 2025 at 04:28:37PM +0200, Andy Shevchenko wrote:
> > On Tue, Feb 04, 2025 at 01:45:13AM +0100, Frederic Weisbecker wrote:
> > > Le Mon, Feb 03, 2025 at 06:48:55PM +0200, Andy Shevchenko a écrit :
> > > > Recently introduced kthread_affine_preferred() has a bug that the value
> > > > of ret variable set but not used. This breaks the compilation with error
> > > > (assume default CONFIG_WERROR=y and `make W=1` to run the build):
> > > > 
> > > > kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> > > > 
> > > > Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > 
> > > Thanks but I already have it queued there:
> > > 
> > > https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?h=kthread/fixes&id=1b0332a42656b798bea867631d739de023633ec6
> > > 
> > > I'll do a pull request shortly.
> > 
> > I'm fine with any approach as long as the issue will be fixed rather sooner.
> 
> Any news? As of today no appearance of the (alternative) fix either in upstream,
> or in Linux Next. What's the plan, please?

It's there for a week or so. I must confess I should have advertized it:

1b0332a42656 ("kthread: Fix return value on kzalloc() failure in kthread_affine_preferred()")

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/1] kthread: Return the assigned value rather than 0
  2025-02-07 18:32       ` Frederic Weisbecker
@ 2025-02-07 19:02         ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2025-02-07 19:02 UTC (permalink / raw)
  To: Frederic Weisbecker; +Cc: linux-kernel

On Fri, Feb 07, 2025 at 07:32:27PM +0100, Frederic Weisbecker wrote:
> Le Fri, Feb 07, 2025 at 04:40:14PM +0200, Andy Shevchenko a écrit :
> > On Tue, Feb 04, 2025 at 04:28:37PM +0200, Andy Shevchenko wrote:
> > > On Tue, Feb 04, 2025 at 01:45:13AM +0100, Frederic Weisbecker wrote:
> > > > Le Mon, Feb 03, 2025 at 06:48:55PM +0200, Andy Shevchenko a écrit :
> > > > > Recently introduced kthread_affine_preferred() has a bug that the value
> > > > > of ret variable set but not used. This breaks the compilation with error
> > > > > (assume default CONFIG_WERROR=y and `make W=1` to run the build):
> > > > > 
> > > > > kernel/kthread.c:862:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> > > > > 
> > > > > Fixes: 4d13f4304fa4 ("kthread: Implement preferred affinity")
> > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > 
> > > > Thanks but I already have it queued there:
> > > > 
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks.git/commit/?h=kthread/fixes&id=1b0332a42656b798bea867631d739de023633ec6
> > > > 
> > > > I'll do a pull request shortly.
> > > 
> > > I'm fine with any approach as long as the issue will be fixed rather sooner.
> > 
> > Any news? As of today no appearance of the (alternative) fix either in upstream,
> > or in Linux Next. What's the plan, please?
> 
> It's there for a week or so. I must confess I should have advertized it:
> 
> 1b0332a42656 ("kthread: Fix return value on kzalloc() failure in kthread_affine_preferred()")

Thank you, I see it now!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-07 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 16:48 [PATCH v1 1/1] kthread: Return the assigned value rather than 0 Andy Shevchenko
2025-02-04  0:45 ` Frederic Weisbecker
2025-02-04 14:28   ` Andy Shevchenko
2025-02-07 14:40     ` Andy Shevchenko
2025-02-07 18:32       ` Frederic Weisbecker
2025-02-07 19:02         ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox