On 05.04.2024 16:47, Jani Nikula wrote:
On Mon, 27 Feb 2023, Peter Zijlstra wrote:
On Thu, Feb 23, 2023 at 10:24:19PM +0100, Andrzej Hajda wrote:
On 22.02.2023 18:04, Peter Zijlstra wrote:
On Wed, Jan 18, 2023 at 04:35:22PM +0100, Andrzej Hajda wrote:
Andrzej Hajda (7):
arch: rename
On 22.02.2023 18:04, Peter Zijlstra wrote:
On Wed, Jan 18, 2023 at 04:35:22PM +0100, Andrzej Hajda wrote:
Andrzej Hajda (7):
arch: rename all internal names __xchg to __arch_xchg
linux/include: add non-atomic version of xchg
arch/*/uprobes: simplify arch_uretprobe_hijack_return_addr
Hi,
Ping on the series.
Arnd, Andrew is there anything more I can do to push the process forward?
Regards
Andrzej
On 18.01.2023 16:35, Andrzej Hajda wrote:
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
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
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
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
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/ll
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
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
__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
ml
[2]: https://en.cppreference.com/w/cpp/header/utility
Regards
Andrzej
Andrzej Hajda (7):
arch: rename all internal names __xchg to __arch_xchg
linux/include: add non-atomic version of xchg
arch/*/uprobes: simplify arch_uretprobe_hijack_return_addr
llist: simplify __llist_del_all
io_uri
On 10.01.2023 12:07, Andy Shevchenko wrote:
On Tue, Jan 10, 2023 at 11:53:06AM +0100, Andrzej Hajda wrote:
This patch tries to show usability of __xchg helper.
It is not intended to be merged, but I can convert
it to proper patchset if necessary.
There are many more places where __xchg can be
-by: Andrzej Hajda
---
arch/arm/probes/uprobes/core.c| 8 ++--
arch/csky/kernel/probes/uprobes.c | 9 ++---
arch/mips/kernel/irq_txx9.c | 7 ++-
arch/mips/kernel/process.c| 8 +++-
arch/mips/kernel/uprobes.c
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
Reviewed-by: Arnd Bergmann
---
v2: squashed all arch patches into one
v3: fixed alpha/xchg_local, thx to l...@intel.com
v4: adjusted indentation (Heiko)
---
arch/alpha/include/asm/cmpxchg.h | 10 +-
arch
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
Reviewed-by: Arnd Bergmann
---
v2: squashed all arch patches into one
v3: fixed alpha/xchg_local, thx to l...@intel.com
---
arch/alpha/include/asm/cmpxchg.h | 8
arch/arc/include/asm/cmpxchg.h | 4
__xchg will be used for non-atomic xchg macro.
Signed-off-by: Andrzej Hajda
Reviewed-by: Arnd Bergmann
---
arch/alpha/include/asm/cmpxchg.h | 6 +++---
arch/arc/include/asm/cmpxchg.h | 4 ++--
arch/arm/include/asm/cmpxchg.h | 4 ++--
arch/arm64/include/asm/cmpxchg.h | 4
Forgive me late response - Holidays,
On 22.12.2022 18:21, Andrew Morton wrote:
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
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
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
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/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
__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
__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
__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
__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
__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
__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
__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
__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/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/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
__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
__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
__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
__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
__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
__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
[0]: https://lore.kernel.org/lkml/y5ofsvaybv4xc...@smile.fi.intel.com/T/
[1]: https://doc.rust-lang.org/std/mem/index.html
[2]: https://en.cppreference.com/w/cpp/header/utility
Regards
Andrzej
Andrzej Hajda (19):
arch/alpha: rename internal name __xchg to __arch_xchg
arch/arc: rename internal name _
Unsigned type is always non-negative, so the loop could not end in case
condition is never true.
The problem has been detected using semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci
Signed-off-by: Andrzej Hajda
---
arch/powerpc/platforms/powernv/pci-ioda.c | 2 +-
1 file
: Andrzej Hajda
---
drivers/usb/gadget/udc/fsl_qe_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c
b/drivers/usb/gadget/udc/fsl_qe_udc.c
index 53c0692..93d28cb 100644
--- a/drivers/usb/gadget/udc/fsl_qe_udc.c
+++ b/drivers/usb/gadget/udc
et)
[1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
[2]: http://permalink.gmane.org/gmane.linux.kernel/2150581
Regards
Andrzej
Andrzej Hajda (7):
netfilter: fix IS_ERR_VALUE usage
MIPS: module: fix incorrect IS_ERR_VALUE macro usages
drivers: char: mem: fix IS_ERROR_VALUE usage
atmel-isi:
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda
---
Hi,
To avoid problems with too many
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +--
1 file changed, 1 insertion(+), 2
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda
---
arch/powerpc/kernel/nvram_64.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
On 11/04/2014 11:45 AM, Grant Likely wrote:
> Currently the devices created by drivers/of/platform.c get created at
> the root of /sys/devices. This goes against the typical pattern for
> sysfs where the top level /sys/devices structure contains categories of
> devices, and the structure of devices
Since backlight core returns props.brightness in case get_brightness
is not implemented trivial implementations are not needed anymore.
Signed-off-by: Andrzej Hajda
---
drivers/macintosh/via-pmu-backlight.c | 6 --
drivers/platform/x86/samsung-q10.c | 6 --
drivers/video
Many implementations of get_brightness operation returns only value
of props.brightness field. This change makes such implementations
unnecessary.
Signed-off-by: Andrzej Hajda
---
drivers/video/backlight/backlight.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/video/backlight
This patchset makes get_brightness callback optional
and removes trivial implementations.
Driver changes are quite obvious so I have put them into single
patch.
The patchset is based on the current linux-next branch.
Regards
Andrzej
Andrzej Hajda (2):
backlight: show brightness even if
48 matches
Mail list logo