]> www.infradead.org Git - users/jedix/linux-maple.git/commit
jump_label: Clarify condition in static_key_fast_inc_not_disabled()
authorThomas Gleixner <tglx@linutronix.de>
Mon, 10 Jun 2024 12:46:37 +0000 (14:46 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 11 Jun 2024 09:25:23 +0000 (11:25 +0200)
commit695ef796467ed228b60f1915995e390aea3d85c6
tree6303760e45a615d9712c02520b420d6d10f5b695
parent83ab38ef0a0b2407d43af9575bb32333fdd74fb2
jump_label: Clarify condition in static_key_fast_inc_not_disabled()

The second part of

      if (v <= 0 || (v + 1) < 0)

is not immediately obvious that it acts as overflow protection.

Check explicitely for v == INT_MAX instead and add a proper comment how
this is used at the call sites.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20240610124406.484973160@linutronix.de
kernel/jump_label.c