Skip to contentSkip to conversation

m32r-fix-build-warning.patch removed from -mm tree

merged [email protected] 1 participant 1 message Feb 23, 2017

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: m32r: fix build warning
has been removed from the -mm tree. Its filename was
m32r-fix-build-warning.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Sudip Mukherjee <[email protected]>
Subject: m32r: fix build warning

Some m32r builds were having a warning:

arch/m32r/include/asm/cmpxchg.h:191:3:
warning: value computed is not used

arch/m32r/include/asm/cmpxchg.h:68:3:
warning: value computed is not used

Taking the idea from e001bbae7147 ("ARM: cmpxchg: avoid warnings from macro-ized cmpxchg() implementations") the m32r implementation is changed to use a similar construct with a compound expression instead of a typecast, which causes the compiler to not complain about an unused result.

---

 arch/m32r/include/asm/cmpxchg.h |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
arch/m32r/include/asm/cmpxchg.h renamed from arch/m32r/include/asm/cmpxchg.h~m32r-fix-build-warning +10 -5
diff -puN arch/m32r/include/asm/cmpxchg.h~m32r-fix-build-warning arch/m32r/include/asm/cmpxchg.h
@@ -64,8 +64,10 @@ __xchg(unsigned long x, volatile void *p
 	return (tmp);
 }
 
-#define xchg(ptr, x)							\
-	((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
+#define xchg(ptr, x) ({							\
+	((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr),		\
+				    sizeof(*(ptr))));			\
+})
 
 static __always_inline unsigned long
 __xchg_local(unsigned long x, volatile void *ptr, int size)
@@ -187,9 +189,12 @@ __cmpxchg(volatile void *ptr, unsigned l
 	return old;
 }
 
-#define cmpxchg(ptr, o, n)						 \
-	((__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)(o),	 \
-			(unsigned long)(n), sizeof(*(ptr))))
+#define cmpxchg(ptr, o, n) ({				\
+	((__typeof__(*(ptr)))				\
+		 __cmpxchg((ptr), (unsigned long)(o),	\
+			   (unsigned long)(n),		\
+			   sizeof(*(ptr))));		\
+})
 
 #include <asm-generic/cmpxchg-local.h>
 

_

Patches currently in -mm which might be from [email protected] are

frv-pci-frv-fix-build-warning.patch