]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hrtimer: Convert state and properties to boolean
authorThomas Gleixner <tglx@kernel.org>
Tue, 24 Feb 2026 16:37:23 +0000 (17:37 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 27 Feb 2026 15:40:11 +0000 (16:40 +0100)
commit22f011be7aaa77ca8f502b9dd07b7334f9965d18
tree790ac27f3b72bad0d267c2adb9443748a5f9de9d
parent7d27eafe54659d19cef10dab4520cbcdfb17b0e3
hrtimer: Convert state and properties to boolean

All 'u8' flags are true booleans, so make it entirely clear that these can
only contain true or false.

This is especially true for hrtimer::state, which has a historical leftover
of using the state with bitwise operations. That was used in the early
hrtimer implementation with several bits, but then converted to a boolean
state. But that conversion missed to replace the bit OR and bit check
operations all over the place, which creates suboptimal code. As of today
'state' is a misnomer because it's only purpose is to reflect whether the
timer is enqueued into the RB-tree or not. Rename it to 'is_queued' and
make all operations on it boolean.

This reduces text size from 8926 to 8732 bytes.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260224163430.542427240@kernel.org
include/linux/hrtimer.h
include/linux/hrtimer_types.h
kernel/time/hrtimer.c
kernel/time/timer_list.c