From: "Paul E. McKenney" <paulmck@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 5658/8441] kernel/rcu/update.c:529:6: warning: no previous prototype for function 'torture_sched_setaffinity'
Date: Fri, 11 Aug 2023 09:10:39 -0700 [thread overview]
Message-ID: <d73b2fa1-fc12-4e1c-9dc6-a0505ea96ec1@paulmck-laptop> (raw)
In-Reply-To: <202308111926.gYjAUtn4-lkp@intel.com>
On Fri, Aug 11, 2023 at 07:13:48PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: 21ef7b1e17d039053edaeaf41142423810572741
> commit: 521ec59e5453e03a255e183ccee844fe3612f1b4 [5658/8441] torture: Move rcutorture_sched_setaffinity() out of rcutorture
> config: x86_64-randconfig-x012-20230811 (https://download.01.org/0day-ci/archive/20230811/202308111926.gYjAUtn4-lkp@intel.com/config)
> compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
> reproduce: (https://download.01.org/0day-ci/archive/20230811/202308111926.gYjAUtn4-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202308111926.gYjAUtn4-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> >> kernel/rcu/update.c:529:6: warning: no previous prototype for function 'torture_sched_setaffinity' [-Wmissing-prototypes]
> long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
> ^
> kernel/rcu/update.c:529:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
> long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
> ^
> static
> 1 warning generated.
>
>
> vim +/torture_sched_setaffinity +529 kernel/rcu/update.c
>
> 526
> 527 #if IS_ENABLED(CONFIG_RCU_TORTURE_TEST) || IS_MODULE(CONFIG_RCU_TORTURE_TEST) || IS_ENABLED(CONFIG_LOCK_TORTURE_TEST) || IS_MODULE(CONFIG_LOCK_TORTURE_TEST)
> 528 /* Get rcutorture access to sched_setaffinity(). */
> > 529 long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
> 530 {
> 531 int ret;
> 532
> 533 ret = sched_setaffinity(pid, in_mask);
> 534 WARN_ONCE(ret, "%s: sched_setaffinity(%d) returned %d\n", __func__, pid, ret);
> 535 return ret;
> 536 }
> 537 EXPORT_SYMBOL_GPL(torture_sched_setaffinity);
> 538 #endif
> 539
Hmmm... The update.c source file includes torture.h which provides the
declaration with the same set of #if conditions as the definition.
But does this diff help?
Thanx, Paul
-----------------------------------------------------------------------
diff --git a/include/linux/torture.h b/include/linux/torture.h
index c98d0c83d117..7d2c070e66d2 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -128,8 +128,6 @@ void _torture_stop_kthread(char *m, struct task_struct **tp);
#define torture_preempt_schedule() do { } while (0)
#endif
-#if IS_ENABLED(CONFIG_RCU_TORTURE_TEST) || IS_MODULE(CONFIG_RCU_TORTURE_TEST) || IS_ENABLED(CONFIG_LOCK_TORTURE_TEST) || IS_MODULE(CONFIG_LOCK_TORTURE_TEST)
long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask);
-#endif
#endif /* __LINUX_TORTURE_H */
next prev parent reply other threads:[~2023-08-11 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 11:13 kernel test robot
2023-08-11 16:10 ` Paul E. McKenney [this message]
2023-08-11 16:48 ` Paul E. McKenney
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=d73b2fa1-fc12-4e1c-9dc6-a0505ea96ec1@paulmck-laptop \
--to=paulmck@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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