11:46 Introduce _xchg, non-atomic xchg Andrzej 11:46 ` Andrzej Hajda * arch/alpha: rename internal name _xchg to _arch_xchg Linux/include: add non-atomic version of xchgĭrm/i915/gt: use _xchg instead of internal helperĪrch/alpha/include/asm/cmpxchg.h | 6 +++-Īrch/arm64/include/asm/cmpxchg.h | 4 ++-Īrch/hexagon/include/asm/cmpxchg.h | 6 +++-Īrch/ia64/include/uapi/asm/cmpxchg.h | 4 ++-Īrch/loongarch/include/asm/cmpxchg.h | 4 ++-Īrch/m68k/include/asm/cmpxchg.h | 6 +++-Īrch/openrisc/include/asm/cmpxchg.h | 4 ++-Īrch/parisc/include/asm/cmpxchg.h | 4 ++-Īrch/powerpc/include/asm/cmpxchg.h | 4 ++-Īrch/riscv/include/asm/cmpxchg.h | 4 ++-Īrch/sparc/include/asm/cmpxchg_32.h | 4 ++-Īrch/sparc/include/asm/cmpxchg_64.h | 4 ++-Īrch/xtensa/include/asm/cmpxchg.h | 4 ++-ĭrivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +. Name of the helper, _xchg follows kernel conventions,Ī) as in this patchset include/linux/non-atomic/xchg.h,ī) include/linux/utils.h ? any better name? Some kindġ7 patches releasing _xchg name from arch filesĪrnd thanks for convienient set of cross compilers, it was very helpful.Īrch/alpha: rename internal name _xchg to _arch_xchgĪrch/arc: rename internal name _xchg to _arch_xchgĪrch/arm: rename internal name _xchg to _arch_xchgĪrch/arm64: rename internal name _xchg to _arch_xchgĪrch/hexagon: rename internal name _xchg to _arch_xchgĪrch/ia64: rename internal name _xchg to _arch_xchgĪrch/loongarch: rename internal name _xchg to _arch_xchgĪrch/m68k: rename internal name _xchg to _arch_xchgĪrch/mips: rename internal name _xchg to _arch_xchgĪrch/openrisc: rename internal name _xchg to _arch_xchgĪrch/parisc: rename internal name _xchg to _arch_xchgĪrch/powerpc: correct logged function names in xchg helpersĪrch/riscv: rename internal name _xchg to _arch_xchgĪrch/s390: rename internal name _xchg to _arch_xchgĪrch/sh: rename internal name _xchg to _arch_xchgĪrch/sparc: rename internal name _xchg to _arch_xchgĪrch/xtensa: rename internal name _xchg to _arch_xchg If the idea is OK there are still 2 qestions to answer:ġ. Helper (_xchg(&x, 0)), which is the same as private helper inī) C++ : 'exchange' from utility header. Presence of similar helpers in other somehow related languages/libs:Ī) Rust: 'replace' from std::mem module, there is also 'take' + previous_min_rate = _xchg(evport->qos.min_rate, min_rate) įor sure the code is more compact, and IMHO more readable.Ģ. previous_min_rate = evport->qos.min_rate Real example from drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c: Code readability/simplification/number of lines: I want to present few arguments why it would be good to have it:ġ. The helper is tiny and there are advices we can leave without it, so This is the 2nd approach of the same idea, with comments addressed. So I've used my intuition to construct to/cc lists, sorry for mistakes. I am not sure who is good person to review/ack such patches, Quick cocci analyze shows there is probably few thousands places I hope there will be place for such tiny helper in kernel. Linux-sh, sparclinux, linux-xtensa, intel-gfx, dri-develĬc: Mark Rutland, Arnd Bergmann, Peter Zijlstra, Boqun Feng,Īndrzej Hajda, Rodrigo Vivi, Andrew Morton, Andy Shevchenko Openrisc, linux-parisc, linuxppc-dev, linux-riscv, linux-s390, Linux-hexagon, linux-ia64, loongarch, linux-m68k, linux-mips, To: linux-alpha, linux-kernel, linux-snps-arc, linux-arm-kernel, ` (20 more replies) 0 siblings, 21 replies 41+ messages in threadįrom: Andrzej Hajda 11:46 UTC ( / raw) 11:46 ` arch/alpha: rename internal name _xchg to _arch_xchg Andrzej Hajda Introduce _xchg, non-atomic xchg archive mirror help / color / mirror / Atom feed * Introduce _xchg, non-atomic xchg 11:46 Andrzej Hajda
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |