Skip to contentSkip to conversation

Fixup and coding convention

PATCH New [email protected] 1 participant 3 messages Aug 1, 2022

Subsystems (3)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/2 csky: cmpxchg: Coding convention for BUILD_BUG()

In reply to [email protected]

From: Guo Ren <[email protected]>

Use BUILD_BUG() instead of the custom bad_xchg.

---
 arch/csky/include/asm/cmpxchg.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
arch/csky/include/asm/cmpxchg.h +5 -6
index 5f693fadb56c..916043b845f1 100644
@@ -4,10 +4,9 @@
 #define __ASM_CSKY_CMPXCHG_H
 
 #ifdef CONFIG_SMP
+#include <linux/bug.h>
 #include <asm/barrier.h>
 
-extern void __bad_xchg(void);
-
 #define __xchg_relaxed(new, ptr, size)				\
 ({								\
 	__typeof__(ptr) __ptr = (ptr);				\
@@ -46,7 +45,7 @@ extern void __bad_xchg(void);
 			:);					\
 		break;						\
 	default:						\
-		__bad_xchg();					\
+		BUILD_BUG();					\
 	}							\
 	__ret;							\
 })
@@ -76,7 +75,7 @@ extern void __bad_xchg(void);
 			:);					\
 		break;						\
 	default:						\
-		__bad_xchg();					\
+		BUILD_BUG();					\
 	}							\
 	__ret;							\
 })
@@ -107,7 +106,7 @@ extern void __bad_xchg(void);
 			:);					\
 		break;						\
 	default:						\
-		__bad_xchg();					\
+		BUILD_BUG();					\
 	}							\
 	__ret;							\
 })
@@ -139,7 +138,7 @@ extern void __bad_xchg(void);
 			:);					\
 		break;						\
 	default:						\
-		__bad_xchg();					\
+		BUILD_BUG();					\
 	}							\
 	__ret;							\
 })
Signature · 1 line
2.36.1

[email protected]

author maintainer
#0 lore raw

cover Fixup and coding convention

From: Guo Ren <[email protected]>

Two small modifications for fixup abiv1 compile and coding convention.

Guo Ren (2):
csky: cmpxchg: Coding convention for BUILD_BUG()
csky: abiv1: Fixup compile error

 arch/csky/abiv1/inc/abi/string.h |  6 ++++++
 arch/csky/include/asm/cmpxchg.h  | 11 +++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
Signature · 1 line
2.36.1
author maintainer
#2 lore raw

PATCH 2/2 csky: abiv1: Fixup compile error

From: Guo Ren <[email protected]>

LD vmlinux.o
arch/csky/lib/string.o: In function `memmove':
string.c:(.text+0x108): multiple definition of memmove' lib/string.o:string.c:(.text+0x7e8): first defined here arch/csky/lib/string.o: In function memset':
string.c:(.text+0x148): multiple definition of `memset' lib/string.o:string.c:(.text+0x2ac): first defined here scripts/Makefile.vmlinux_o:68: recipe for target 'vmlinux.o' failed make[4]: *** [vmlinux.o] Error 1

Fixes e4df2d5e852a ("csky: Add C based string functions")
---
 arch/csky/abiv1/inc/abi/string.h | 6 ++++++
 1 file changed, 6 insertions(+)
arch/csky/abiv1/inc/abi/string.h +6 -0
index 9d95594b0feb..de50117b904d 100644
@@ -6,4 +6,10 @@
 #define __HAVE_ARCH_MEMCPY
 extern void *memcpy(void *, const void *, __kernel_size_t);
 
+#define __HAVE_ARCH_MEMMOVE
+extern void *memmove(void *, const void *, __kernel_size_t);
+
+#define __HAVE_ARCH_MEMSET
+extern void *memset(void *, int,  __kernel_size_t);
+
 #endif /* __ABI_CSKY_STRING_H */
Signature · 1 line
2.36.1