[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20241231.103254.684624162379372838.fujita.tomonori@gmail.com>
Date: Tue, 31 Dec 2024 10:32:54 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: boqun.feng@...il.com
Cc: fujita.tomonori@...il.com, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org, netdev@...r.kernel.org, andrew@...n.ch,
hkallweit1@...il.com, tmgross@...ch.edu, ojeda@...nel.org,
alex.gaynor@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...sung.com, aliceryhl@...gle.com,
anna-maria@...utronix.de, frederic@...nel.org, tglx@...utronix.de,
arnd@...db.de, jstultz@...gle.com, sboyd@...nel.org, mingo@...hat.com,
peterz@...radead.org, juri.lelli@...hat.com, vincent.guittot@...aro.org,
dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
mgorman@...e.de, vschneid@...hat.com
Subject: Re: [PATCH v7 6/7] rust: Add read_poll_timeout functions
On Mon, 30 Dec 2024 10:43:52 -0800
Boqun Feng <boqun.feng@...il.com> wrote:
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index 3e5a6bf587f9..6ed70c801172 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -8670,7 +8670,10 @@ void __init sched_init(void)
>>
>> #ifdef CONFIG_DEBUG_ATOMIC_SLEEP
>>
>> -void __might_sleep(const char *file, int line)
>> +extern inline void __might_resched_precision(const char *file, int len,
>> + int line, unsigned int offsets);
>
> Instead of declaring this as an "extern inline" I think you can just
> make it a static inline and move the function body up here. It should
> resolve the sparse warning.
I made __might_resched_precision() static and simply fixed declaration
in the following way.
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 6ed70c801172..d9ac66dc66d3 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8670,8 +8670,8 @@ void __init sched_init(void)
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
-extern inline void __might_resched_precision(const char *file, int len,
- int line, unsigned int offsets);
+static void __might_resched_precision(const char *file, int len,
+ int line, unsigned int offsets);
void __might_sleep_precision(const char *file, int len, int line)
{
@@ -8719,7 +8719,8 @@ static inline bool resched_offsets_ok(unsigned int offsets)
return nested == offsets;
}
-void __might_resched_precision(const char *file, int len, int line, unsigned int offsets)
+static void __might_resched_precision(const char *file, int len, int line,
+ unsigned int offsets)
{
/* Ratelimiting timestamp: */
static unsigned long prev_jiffy;
Powered by blists - more mailing lists