sst-linux/arch/riscv
Juhan Jin fb5069d017 riscv: ftrace: Add parentheses in macro definitions of make_call_t0 and make_call_ra
[ Upstream commit 5f1a58ed91a040d4625d854f9bb3dd4995919202 ]

This patch adds parentheses to parameters caller and callee of macros
make_call_t0 and make_call_ra. Every existing invocation of these two
macros uses a single variable for each argument, so the absence of the
parentheses seems okay. However, future invocations might use more
complex expressions as arguments. For example, a future invocation might
look like this: make_call_t0(a - b, c, call). Without parentheses in the
macro definition, the macro invocation expands to:

...
unsigned int offset = (unsigned long) c - (unsigned long) a - b;
...

which is clearly wrong.

The use of parentheses ensures arguments are correctly evaluated and
potentially saves future users of make_call_t0 and make_call_ra debugging
trouble.

Fixes: 6724a76cff85 ("riscv: ftrace: Reduce the detour code size to half")
Signed-off-by: Juhan Jin <juhan.jin@foxmail.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/tencent_AE90AA59903A628E87E9F80E563DA5BA5508@qq.com
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-04-10 14:33:40 +02:00
..
boot riscv: dts: sifive: add missing #interrupt-cells to pmic 2024-03-26 18:20:25 -04:00
configs
errata RISC-V: fix taking the text_mutex twice during sifive errata patching 2023-05-17 11:53:41 +02:00
include riscv: ftrace: Add parentheses in macro definitions of make_call_t0 and make_call_ra 2025-04-10 14:33:40 +02:00
kernel riscv: Fix sleeping in invalid context in die() 2025-01-17 13:34:42 +01:00
kvm RISC-V: KVM: Fix sbiret init before forwarding to userspace 2024-10-17 15:20:37 +02:00
lib riscv: uaccess: Return the number of bytes effectively not copied 2023-08-23 17:52:38 +02:00
mm riscv: change XIP's kernel_map.size to be size of the entire kernel 2024-08-29 17:30:13 +02:00
net riscv, bpf: Make BPF_CMPXCHG fully ordered 2024-11-01 01:56:01 +01:00
purgatory riscv/purgatory: align riscv_kernel_entry 2024-11-14 13:15:17 +01:00
Kbuild
Kconfig riscv: define ILLEGAL_POINTER_VALUE for 64bit 2024-10-17 15:21:57 +02:00
Kconfig.debug
Kconfig.erratas
Kconfig.socs riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE 2023-12-13 18:39:29 +01:00
Makefile riscv: Handle zicsr/zifencei issues between clang and binutils 2023-03-30 12:49:28 +02:00