Thread (8 messages) 8 messages, 1 author, 1d ago

[PATCH 2/7] loongarch: Remove the unused non-atomic local_t functions

flat view
WARM1d

From: Jerome Marchand <hidden>
Date: 2026-10-26 11:18:51
Also in: linux-alpha, linux-arch, linux-mips, lkml, loongarch
Subsystem: loongarch, the rest · Maintainers: Huacai Chen, Linus Torvalds

While working on a fix for a tracing soft lockup, it came to my
attention that __local_dec() was broken on ppc64 and other arches (it
actually increment the value). My first instinct was to fix it but the
fact that this function was utterly broken for so long, decades for
some arches makes me thing that those functions have not been used for
a long time, if ever.

Anyway, they're not used now, so remove them.

Signed-off-by: Jerome Marchand <redacted>
---
 arch/loongarch/include/asm/local.h | 10 ----------
 1 file changed, 10 deletions(-)
diff --git a/arch/loongarch/include/asm/local.h b/arch/loongarch/include/asm/local.h
index 2d118b1a060e4..d649b9867ba25 100644
--- a/arch/loongarch/include/asm/local.h
+++ b/arch/loongarch/include/asm/local.h
@@ -175,14 +175,4 @@ local_add_unless(local_t *l, long a, long u)
  */
 #define local_add_negative(i, l) (local_add_return(i, (l)) < 0)
 
-/* Use these for per-cpu local_t variables: on some archs they are
- * much more efficient than these naive implementations.  Note they take
- * a variable, not an address.
- */
-
-#define __local_inc(l)		((l)->a.counter++)
-#define __local_dec(l)		((l)->a.counter++)
-#define __local_add(i, l)	((l)->a.counter += (i))
-#define __local_sub(i, l)	((l)->a.counter -= (i))
-
 #endif /* _ARCH_LOONGARCH_LOCAL_H */
-- 
2.56.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help