summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2026-11-15 14:18:07 -0700
committerMadhavan Srinivasan <maddy@linux.ibm.com>2026-11-20 13:25:17 +0530
commit9ea01307e6c824eb0b8934d95d52bbacae17887d (patch)
tree2be78670489be437399438fa583d52cebb5146c2 /tools/perf/scripts/python
parentd0160f6470d1b8a4ce25d98bb8d1b0495a922d4f (diff)
powerpc/xmon: Avoid unsequenced accesses to tsk in show_task()
After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in show_task(), which can break the build with CONFIG_PPC_WERROR=y / CONFIG_WERROR=y / W=e: arch/powerpc/xmon/xmon.c:3262:3: error: unsequenced accesses to volatile qualified 'tsk' [-Werror,-Wunsequenced] 3261 | printf("%16px %16lx %16px %6d %6d %c %2d %s\n", tsk, | ~~~ 3262 | tsk->thread.ksp, tsk->thread.regs, | ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. tsk was made volatile in commit a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") to ensure its value in show_tasks() was properly restored after returning from a potential longjmp(). Aside from that, the value is not being modified through other means, so rename the volatile parameter and add a local variable named tsk to hold its value throughout show_task(), clearing up the warning. Cc: stable@vger.kernel.org Fixes: a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") Closes: https://github.com/ClangBuiltLinux/linux/issues/2199 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20261115-xmon-wunsequenced-v1-1-42ae3fe45bf4@kernel.org
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions