Skip to contentSkip to conversation

ARC: build: Use __force to suppress per-CPU cmpxchg warnings

PATCH New Vineet Gupta 1 participant 1 message Oct 16, 2024 1 message not in the archive Synopsys ARC architecture

lore
Share & tools
lore

Vineet Gupta

author maintainer
#1 lore raw

PATCH 3/3 ARC: build: Use __force to suppress per-CPU cmpxchg warnings

In reply to a message not in the archive

From: "Paul E. McKenney" <[email protected]>

Currently, the cast of the first argument to cmpxchg_emu_u8() drops the __percpu address-space designator, which results in sparse complaints when applying cmpxchg() to per-CPU variables in ARC. Therefore, use __force to suppress these complaints, given that this does not pertain to cmpxchg() semantics, which are plently well-defined on variables in general, whether per-CPU or otherwise.

---
 arch/arc/include/asm/cmpxchg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arc/include/asm/cmpxchg.h +1 -1
index 58045c898340..76f43db0890f 100644
@@ -48,7 +48,7 @@
 									\
 	switch(sizeof((_p_))) {						\
 	case 1:								\
-		_prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *)_p_, (uintptr_t)_o_, (uintptr_t)_n_);	\
+		_prev_ = (__typeof__(*(ptr)))cmpxchg_emu_u8((volatile u8 *__force)_p_, (uintptr_t)_o_, (uintptr_t)_n_);	\
 		break;							\
 	case 4:								\
 		_prev_ = __cmpxchg(_p_, _o_, _n_);			\
Signature · 7 lines
2.43.0


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc