[tip: timers/urgent] hrtimers: Mark is_migration_base() with __always_inline

tip-bot2 for Andy Shevchenko posted 1 patch 11 months ago
There is a newer version of this series
kernel/time/hrtimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[tip: timers/urgent] hrtimers: Mark is_migration_base() with __always_inline
Posted by tip-bot2 for Andy Shevchenko 11 months ago
The following commit has been merged into the timers/urgent branch of tip:

Commit-ID:     3ff6e36be060f0a8870f76155e14de128058b964
Gitweb:        https://git.kernel.org/tip/3ff6e36be060f0a8870f76155e14de128058b964
Author:        Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate:    Thu, 16 Jan 2025 18:07:45 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Thu, 23 Jan 2025 11:47:23 +01:00

hrtimers: Mark is_migration_base() with __always_inline

When is_migration_base() is unused, it prevents kernel builds
with clang, `make W=1` and CONFIG_WERROR=y:

kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
  156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
      |                    ^~~~~~~~~~~~~~~~~

Fix this by marking it with __always_inline.

[ tglx: Use __always_inline instead of __maybe_unused ]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250116160745.243358-1-andriy.shevchenko@linux.intel.com

---
 kernel/time/hrtimer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index f6d8df9..14bd09c 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -145,7 +145,7 @@ static struct hrtimer_cpu_base migration_cpu_base = {
 
 #define migration_base	migration_cpu_base.clock_base[0]
 
-static inline bool is_migration_base(struct hrtimer_clock_base *base)
+static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
 {
 	return base == &migration_base;
 }
@@ -275,7 +275,7 @@ again:
 
 #else /* CONFIG_SMP */
 
-static inline bool is_migration_base(struct hrtimer_clock_base *base)
+static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
 {
 	return false;
 }
Re: [tip: timers/urgent] hrtimers: Mark is_migration_base() with __always_inline
Posted by Andy Shevchenko 11 months ago
On Thu, Jan 23, 2025 at 10:57:32AM -0000, tip-bot2 for Andy Shevchenko wrote:
> The following commit has been merged into the timers/urgent branch of tip:
> 
> Commit-ID:     3ff6e36be060f0a8870f76155e14de128058b964
> Gitweb:        https://git.kernel.org/tip/3ff6e36be060f0a8870f76155e14de128058b964
> Author:        Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> AuthorDate:    Thu, 16 Jan 2025 18:07:45 +02:00
> Committer:     Thomas Gleixner <tglx@linutronix.de>
> CommitterDate: Thu, 23 Jan 2025 11:47:23 +01:00
> 
> hrtimers: Mark is_migration_base() with __always_inline
> 
> When is_migration_base() is unused, it prevents kernel builds
> with clang, `make W=1` and CONFIG_WERROR=y:
> 
> kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
>   156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
>       |                    ^~~~~~~~~~~~~~~~~
> 
> Fix this by marking it with __always_inline.

> [ tglx: Use __always_inline instead of __maybe_unused ]

Thanks, but it doesn't fix the problem:

kernel/time/hrtimer.c:156:29: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
  156 | static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
      |                             ^~~~~~~~~~~~~~~~~
1 error generated.

-- 
With Best Regards,
Andy Shevchenko
Re: [tip: timers/urgent] hrtimers: Mark is_migration_base() with __always_inline
Posted by Thomas Gleixner 11 months ago
On Thu, Jan 23 2025 at 16:39, Andy Shevchenko wrote:
> On Thu, Jan 23, 2025 at 10:57:32AM -0000, tip-bot2 for Andy Shevchenko wrote:
>> The following commit has been merged into the timers/urgent branch of tip:
>> 
>> Commit-ID:     3ff6e36be060f0a8870f76155e14de128058b964
>> Gitweb:        https://git.kernel.org/tip/3ff6e36be060f0a8870f76155e14de128058b964
>> Author:        Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> AuthorDate:    Thu, 16 Jan 2025 18:07:45 +02:00
>> Committer:     Thomas Gleixner <tglx@linutronix.de>
>> CommitterDate: Thu, 23 Jan 2025 11:47:23 +01:00
>> 
>> hrtimers: Mark is_migration_base() with __always_inline
>> 
>> When is_migration_base() is unused, it prevents kernel builds
>> with clang, `make W=1` and CONFIG_WERROR=y:
>> 
>> kernel/time/hrtimer.c:156:20: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
>>   156 | static inline bool is_migration_base(struct hrtimer_clock_base *base)
>>       |                    ^~~~~~~~~~~~~~~~~
>> 
>> Fix this by marking it with __always_inline.
>
>> [ tglx: Use __always_inline instead of __maybe_unused ]
>
> Thanks, but it doesn't fix the problem:
>
> kernel/time/hrtimer.c:156:29: error: unused function 'is_migration_base' [-Werror,-Wunused-function]
>   156 | static __always_inline bool is_migration_base(struct hrtimer_clock_base *base)
>       |                             ^~~~~~~~~~~~~~~~~
> 1 error generated.

This is insane. Let me undo that for heavens sake.