On Thu, 22 Dec 2022 12:46:16 +0100 Andrzej Hajda
wrote:
> Hi all,
>
> I hope there will be place for such tiny helper in kernel.
> Quick cocci analyze shows there is probably few thousands places
> where it could be useful.
So to clarify, the intent here is a simple readability cleanup for
exi
On 22.12.2022 15:12, Geert Uytterhoeven wrote:
Hi Andrzej,
Thanks for your series!
On Thu, Dec 22, 2022 at 12:49 PM Andrzej Hajda wrote:
I hope there will be place for such tiny helper in kernel.
Quick cocci analyze shows there is probably few thousands places
where it could be useful.
I a
Hi Andrzej,
Thanks for your series!
On Thu, Dec 22, 2022 at 12:49 PM Andrzej Hajda wrote:
> I hope there will be place for such tiny helper in kernel.
> Quick cocci analyze shows there is probably few thousands places
> where it could be useful.
> I am not sure who is good person to review/ack s
On Thu, Dec 22, 2022 at 12:46:34PM +0100, Andrzej Hajda wrote:
> 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.
FWIW,
Reviewed-by: A
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/parisc/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/parisc/include/asm/cmpxchg.h
b/arch/parisc/include/asm/cmpxchg.h
index 5f274be105671e..c1d776bb16b4ed 10
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/riscv/include/asm/atomic.h | 2 +-
arch/riscv/include/asm/cmpxchg.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/riscv/include/asm/atomic.h b/arch/riscv/include/asm/atomic.h
ind
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
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/xtensa/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/xtensa/include/asm/cmpxchg.h
b/arch/xtensa/include/asm/cmpxchg.h
index eb87810357ad88..675a11ea8de76b 10
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/sparc/include/asm/cmpxchg_32.h | 4 ++--
arch/sparc/include/asm/cmpxchg_64.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/sparc/include/asm/cmpxchg_32.h
b/arch/sparc/include/asm
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/sh/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sh/include/asm/cmpxchg.h b/arch/sh/include/asm/cmpxchg.h
index 0ed9b3f4a57796..288f6f38d98fb4 100644
--- a/ar
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
---
include/linux/non-atomic/xchg.h | 19 +++
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/arm/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h
index 4dfe538dfc689b..6953fc05a97886 100644
--- a
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/arc/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h
index c5b544a5fe8106..e138fde067dea5 100644
--- a
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/openrisc/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/openrisc/include/asm/cmpxchg.h
b/arch/openrisc/include/asm/cmpxchg.h
index 79fd16162ccb6d..5725e22e106
Hi all,
I hope there will be place for such tiny helper in kernel.
Quick cocci analyze shows there is probably few thousands places
where it could be useful.
I am not sure who is good person to review/ack such patches,
so I've used my intuition to construct to/cc lists, sorry for mistakes.
This is
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/arm64/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h
index 497acf134d9923..3a36ba58e8c2ef 100644
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/ia64/include/asm/cmpxchg.h | 2 +-
arch/ia64/include/uapi/asm/cmpxchg.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/ia64/include/asm/cmpxchg.h b/arch/ia64/include/asm/cmpxc
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/powerpc/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/cmpxchg.h
b/arch/powerpc/include/asm/cmpxchg.h
index 05f246c0e36eb3..b5624c9fe09bf7
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/alpha/include/asm/cmpxchg.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/alpha/include/asm/cmpxchg.h b/arch/alpha/include/asm/cmpxchg.h
index 6e0a850aa9d38c..40e8159ef6e794 1006
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/hexagon/include/asm/cmpxchg.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/hexagon/include/asm/cmpxchg.h
b/arch/hexagon/include/asm/cmpxchg.h
index cdb705e1496af8..92dc5e5f836f
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/mips/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/include/asm/cmpxchg.h b/arch/mips/include/asm/cmpxchg.h
index 7ec9493b28614f..feed343ad483a9 100644
--
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/loongarch/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/loongarch/include/asm/cmpxchg.h
b/arch/loongarch/include/asm/cmpxchg.h
index ecfa6cf79806e6..979fde61
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/m68k/include/asm/cmpxchg.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/m68k/include/asm/cmpxchg.h b/arch/m68k/include/asm/cmpxchg.h
index 6cf464cdab067e..d7f3de9c5d6f79 100644
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
---
arch/s390/include/asm/cmpxchg.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/cmpxchg.h b/arch/s390/include/asm/cmpxchg.h
index 84c3f0d576c5b1..efc16f4aac8643 100644
--
24 matches
Mail list logo