[PATCH v5 7/7] drm/i915/gt: use __xchg instead of internal helper

2023-01-18 Thread Andrzej Hajda
Prefer core helper if available. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/i915/gt/intel_engine_cs.c| 2 +- drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_execlists_submission.c | 4 ++-- drivers/gpu/drm/i915/gt/intel_ggtt.c

[PATCH v5 6/7] qed: use __xchg if possible

2023-01-18 Thread Andrzej Hajda
Recently introduced helper simplifies the code. Signed-off-by: Andrzej Hajda --- include/linux/qed/qed_chain.h | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/include/linux/qed/qed_chain.h b/include/linux/qed/qed_chain.h index a84063492c71ae..6355d558cf01

[PATCH v5 5/7] io_uring: use __xchg if possible

2023-01-18 Thread Andrzej Hajda
Recently introduced helper simplifies the code. Signed-off-by: Andrzej Hajda --- io_uring/io_uring.c | 7 ++- io_uring/slist.h| 6 ++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 2ac1cd8d23ea62..2b46a692d69022 100644 -

[PATCH v5 4/7] llist: simplify __llist_del_all

2023-01-18 Thread Andrzej Hajda
llist_del_all uses xchg, let's use __xchg here. Signed-off-by: Andrzej Hajda --- include/linux/llist.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/llist.h b/include/linux/llist.h index 85bda2d02d65be..4dc1d185ea98ab 100644 --- a/include/linux/llist.h +

[PATCH v5 3/7] arch/*/uprobes: simplify arch_uretprobe_hijack_return_addr

2023-01-18 Thread Andrzej Hajda
In all architectures, except x86, arch_uretprobe_hijack_return_addr is just __xchg. Signed-off-by: Andrzej Hajda --- arch/arm/probes/uprobes/core.c | 8 ++-- arch/arm64/kernel/probes/uprobes.c | 9 ++--- arch/csky/kernel/probes/uprobes.c | 9 ++--- arch/mips/kernel/uprobes.c

[PATCH v5 2/7] linux/include: add non-atomic version of xchg

2023-01-18 Thread Andrzej Hajda
The pattern of setting variable with new value and returning old one is very common in kernel. Usually atomicity of the operation is not required, so xchg seems to be suboptimal and confusing in such cases. Signed-off-by: Andrzej Hajda Reviewed-by: Andy Shevchenko --- include/linux/non-atomic/x

[PATCH v5 1/7] arch: rename all internal names __xchg to __arch_xchg

2023-01-18 Thread Andrzej Hajda
__xchg will be used for non-atomic xchg macro. Signed-off-by: Andrzej Hajda Reviewed-by: Arnd Bergmann Acked-by: Geert Uytterhoeven [m68k] Acked-by: Palmer Dabbelt [riscv] --- v2: squashed all arch patches into one v3: fixed alpha/xchg_local, thx to l...@intel.com v4: adjusted indentation (Hei

[PATCH v5 0/7] Introduce __xchg, non-atomic xchg

2023-01-18 Thread Andrzej Hajda
Hi all, The helper is tiny and there are advices we can live without it, so I want to present few arguments why it would be good to have it: 1. Code readability/simplification/number of lines: - decreases number of lines, - it often eliminates local variables, - for real examples see patche