perf: Move common code into both rb and aux branches
authorPeter Zijlstra <peterz@infradead.org>
Tue, 12 Aug 2025 10:39:04 +0000 (12:39 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 Aug 2025 11:12:59 +0000 (13:12 +0200)
commit4118994b33bb628dd9aeb941c5af6f950f1dea90
treea8f37bb541831c3cb3900b4663bbd5df311d42ac
parent3821f258686691cf12bbfc636ab22fa2b049dc86
perf: Move common code into both rb and aux branches

  if (cond) {
    A;
  } else {
    B;
  }
  C;

into

  if (cond) {
    A;
    C;
  } else {
    B;
    C;
  }

Notably C has a success branch and both A and B have two places for
success. For A (rb case), duplicate the success case because later
patches will result in them no longer being identical. For B (aux
case), share using goto (cleaned up later).

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://lore.kernel.org/r/20250812104019.016252852@infradead.org
kernel/events/core.c