linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF
@ 2020-05-28  8:27 Tiezhu Yang
  2020-05-29  1:24 ` Huacai Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Tiezhu Yang @ 2020-05-28  8:27 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel, Xuefeng Li

Replace PTR_STR with INST_PTR_STR to fix the following build warning when
CONFIG_TEST_PRINTF is set:

  CC      lib/test_printf.o
lib/test_printf.c:214:0: warning: "PTR_STR" redefined
 #define PTR_STR "ffff0123456789ab"
 ^
In file included from ./arch/mips/include/asm/dsemul.h:11:0,
                 from ./arch/mips/include/asm/processor.h:22,
                 from ./arch/mips/include/asm/thread_info.h:16,
                 from ./include/linux/thread_info.h:38,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/mips/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from lib/test_printf.c:10:
./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition
 #define PTR_STR  ".dword"
 ^

Fixes: e701656ec4db ("MIPS: inst.h: Stop including asm.h to avoid various build failures")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/mips/include/asm/inst.h | 180 +++++++++++++++++++++----------------------
 1 file changed, 90 insertions(+), 90 deletions(-)

diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
index 6d74ba3..3ab1c6b 100644
--- a/arch/mips/include/asm/inst.h
+++ b/arch/mips/include/asm/inst.h
@@ -14,10 +14,10 @@
 #include <uapi/asm/inst.h>
 
 #if (_MIPS_SZPTR == 32)
-#define PTR_STR		".word"
+#define INST_PTR_STR		".word"
 #endif
 #if (_MIPS_SZPTR == 64)
-#define PTR_STR		".dword"
+#define INST_PTR_STR		".dword"
 #endif
 
 /* HACHACHAHCAHC ...  */
@@ -108,8 +108,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -129,8 +129,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -162,10 +162,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -190,8 +190,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -213,8 +213,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -233,8 +233,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -266,10 +266,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -311,14 +311,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
-		PTR_STR"\t5b, 11b\n\t"		    \
-		PTR_STR"\t6b, 11b\n\t"		    \
-		PTR_STR"\t7b, 11b\n\t"		    \
-		PTR_STR"\t8b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
+		INST_PTR_STR"\t5b, 11b\n\t"         \
+		INST_PTR_STR"\t6b, 11b\n\t"         \
+		INST_PTR_STR"\t7b, 11b\n\t"         \
+		INST_PTR_STR"\t8b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -343,8 +343,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"              \
-		PTR_STR"\t2b, 4b\n\t"              \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                        \
 		: "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -364,8 +364,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -384,8 +384,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -413,10 +413,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -453,14 +453,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
-		PTR_STR"\t5b, 11b\n\t"		    \
-		PTR_STR"\t6b, 11b\n\t"		    \
-		PTR_STR"\t7b, 11b\n\t"		    \
-		PTR_STR"\t8b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
+		INST_PTR_STR"\t5b, 11b\n\t"         \
+		INST_PTR_STR"\t6b, 11b\n\t"         \
+		INST_PTR_STR"\t7b, 11b\n\t"         \
+		INST_PTR_STR"\t8b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -486,8 +486,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -507,8 +507,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -540,10 +540,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -569,8 +569,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -592,8 +592,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -612,8 +612,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=&r" (value), "=r" (res)         \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -645,10 +645,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -690,14 +690,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
-		PTR_STR"\t5b, 11b\n\t"		    \
-		PTR_STR"\t6b, 11b\n\t"		    \
-		PTR_STR"\t7b, 11b\n\t"		    \
-		PTR_STR"\t8b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
+		INST_PTR_STR"\t5b, 11b\n\t"         \
+		INST_PTR_STR"\t6b, 11b\n\t"         \
+		INST_PTR_STR"\t7b, 11b\n\t"         \
+		INST_PTR_STR"\t8b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (value), "=r" (res)	    \
 		: "r" (addr), "i" (-EFAULT));       \
@@ -720,8 +720,8 @@ do {                                                 \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                        \
 		: "r" (value), "r" (addr), "i" (-EFAULT));\
@@ -741,8 +741,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -761,8 +761,8 @@ do {                                                \
 		"j\t3b\n\t"                         \
 		".previous\n\t"                     \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 4b\n\t"               \
-		PTR_STR"\t2b, 4b\n\t"               \
+		INST_PTR_STR"\t1b, 4b\n\t"          \
+		INST_PTR_STR"\t2b, 4b\n\t"          \
 		".previous"                         \
 		: "=r" (res)                                \
 		: "r" (value), "r" (addr), "i" (-EFAULT));  \
@@ -791,10 +791,10 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
@@ -831,14 +831,14 @@ do {                                                \
 		"j\t10b\n\t"			    \
 		".previous\n\t"			    \
 		".section\t__ex_table,\"a\"\n\t"    \
-		PTR_STR"\t1b, 11b\n\t"		    \
-		PTR_STR"\t2b, 11b\n\t"		    \
-		PTR_STR"\t3b, 11b\n\t"		    \
-		PTR_STR"\t4b, 11b\n\t"		    \
-		PTR_STR"\t5b, 11b\n\t"		    \
-		PTR_STR"\t6b, 11b\n\t"		    \
-		PTR_STR"\t7b, 11b\n\t"		    \
-		PTR_STR"\t8b, 11b\n\t"		    \
+		INST_PTR_STR"\t1b, 11b\n\t"         \
+		INST_PTR_STR"\t2b, 11b\n\t"         \
+		INST_PTR_STR"\t3b, 11b\n\t"         \
+		INST_PTR_STR"\t4b, 11b\n\t"         \
+		INST_PTR_STR"\t5b, 11b\n\t"         \
+		INST_PTR_STR"\t6b, 11b\n\t"         \
+		INST_PTR_STR"\t7b, 11b\n\t"         \
+		INST_PTR_STR"\t8b, 11b\n\t"         \
 		".previous"			    \
 		: "=&r" (res)				    \
 		: "r" (value), "r" (addr), "i" (-EFAULT)    \
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF
  2020-05-28  8:27 [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF Tiezhu Yang
@ 2020-05-29  1:24 ` Huacai Chen
  2020-05-29  7:56   ` Thomas Bogendoerfer
  0 siblings, 1 reply; 4+ messages in thread
From: Huacai Chen @ 2020-05-29  1:24 UTC (permalink / raw)
  To: Tiezhu Yang; +Cc: Thomas Bogendoerfer, open list:MIPS, LKML, Xuefeng Li

Hi, Tiezhu,

On Thu, May 28, 2020 at 4:28 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> Replace PTR_STR with INST_PTR_STR to fix the following build warning when
> CONFIG_TEST_PRINTF is set:
>
>   CC      lib/test_printf.o
> lib/test_printf.c:214:0: warning: "PTR_STR" redefined
>  #define PTR_STR "ffff0123456789ab"
>  ^
> In file included from ./arch/mips/include/asm/dsemul.h:11:0,
>                  from ./arch/mips/include/asm/processor.h:22,
>                  from ./arch/mips/include/asm/thread_info.h:16,
>                  from ./include/linux/thread_info.h:38,
>                  from ./include/asm-generic/preempt.h:5,
>                  from ./arch/mips/include/generated/asm/preempt.h:1,
>                  from ./include/linux/preempt.h:78,
>                  from ./include/linux/spinlock.h:51,
>                  from ./include/linux/seqlock.h:36,
>                  from ./include/linux/time.h:6,
>                  from ./include/linux/stat.h:19,
>                  from ./include/linux/module.h:13,
>                  from lib/test_printf.c:10:
> ./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition
>  #define PTR_STR  ".dword"
>  ^
>
> Fixes: e701656ec4db ("MIPS: inst.h: Stop including asm.h to avoid various build failures")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Thank you for catching this issue, but I think this is not the best
solution. Maciej suggest another solution, and I will send a patch to
fix it.

Huacai
> ---
>  arch/mips/include/asm/inst.h | 180 +++++++++++++++++++++----------------------
>  1 file changed, 90 insertions(+), 90 deletions(-)
>
> diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
> index 6d74ba3..3ab1c6b 100644
> --- a/arch/mips/include/asm/inst.h
> +++ b/arch/mips/include/asm/inst.h
> @@ -14,10 +14,10 @@
>  #include <uapi/asm/inst.h>
>
>  #if (_MIPS_SZPTR == 32)
> -#define PTR_STR                ".word"
> +#define INST_PTR_STR           ".word"
>  #endif
>  #if (_MIPS_SZPTR == 64)
> -#define PTR_STR                ".dword"
> +#define INST_PTR_STR           ".dword"
>  #endif
>
>  /* HACHACHAHCAHC ...  */
> @@ -108,8 +108,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -129,8 +129,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -162,10 +162,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -190,8 +190,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -213,8 +213,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -233,8 +233,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -266,10 +266,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -311,14 +311,14 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> -               PTR_STR"\t5b, 11b\n\t"              \
> -               PTR_STR"\t6b, 11b\n\t"              \
> -               PTR_STR"\t7b, 11b\n\t"              \
> -               PTR_STR"\t8b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
> +               INST_PTR_STR"\t5b, 11b\n\t"         \
> +               INST_PTR_STR"\t6b, 11b\n\t"         \
> +               INST_PTR_STR"\t7b, 11b\n\t"         \
> +               INST_PTR_STR"\t8b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -343,8 +343,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"              \
> -               PTR_STR"\t2b, 4b\n\t"              \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                        \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));\
> @@ -364,8 +364,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                                \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));  \
> @@ -384,8 +384,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                                \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));  \
> @@ -413,10 +413,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (res)                               \
>                 : "r" (value), "r" (addr), "i" (-EFAULT)    \
> @@ -453,14 +453,14 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> -               PTR_STR"\t5b, 11b\n\t"              \
> -               PTR_STR"\t6b, 11b\n\t"              \
> -               PTR_STR"\t7b, 11b\n\t"              \
> -               PTR_STR"\t8b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
> +               INST_PTR_STR"\t5b, 11b\n\t"         \
> +               INST_PTR_STR"\t6b, 11b\n\t"         \
> +               INST_PTR_STR"\t7b, 11b\n\t"         \
> +               INST_PTR_STR"\t8b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (res)                               \
>                 : "r" (value), "r" (addr), "i" (-EFAULT)    \
> @@ -486,8 +486,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -507,8 +507,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -540,10 +540,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -569,8 +569,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -592,8 +592,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -612,8 +612,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -645,10 +645,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -690,14 +690,14 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> -               PTR_STR"\t5b, 11b\n\t"              \
> -               PTR_STR"\t6b, 11b\n\t"              \
> -               PTR_STR"\t7b, 11b\n\t"              \
> -               PTR_STR"\t8b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
> +               INST_PTR_STR"\t5b, 11b\n\t"         \
> +               INST_PTR_STR"\t6b, 11b\n\t"         \
> +               INST_PTR_STR"\t7b, 11b\n\t"         \
> +               INST_PTR_STR"\t8b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (value), "=r" (res)         \
>                 : "r" (addr), "i" (-EFAULT));       \
> @@ -720,8 +720,8 @@ do {                                                 \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                        \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));\
> @@ -741,8 +741,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                                \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));  \
> @@ -761,8 +761,8 @@ do {                                                \
>                 "j\t3b\n\t"                         \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 4b\n\t"               \
> -               PTR_STR"\t2b, 4b\n\t"               \
> +               INST_PTR_STR"\t1b, 4b\n\t"          \
> +               INST_PTR_STR"\t2b, 4b\n\t"          \
>                 ".previous"                         \
>                 : "=r" (res)                                \
>                 : "r" (value), "r" (addr), "i" (-EFAULT));  \
> @@ -791,10 +791,10 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (res)                               \
>                 : "r" (value), "r" (addr), "i" (-EFAULT)    \
> @@ -831,14 +831,14 @@ do {                                                \
>                 "j\t10b\n\t"                        \
>                 ".previous\n\t"                     \
>                 ".section\t__ex_table,\"a\"\n\t"    \
> -               PTR_STR"\t1b, 11b\n\t"              \
> -               PTR_STR"\t2b, 11b\n\t"              \
> -               PTR_STR"\t3b, 11b\n\t"              \
> -               PTR_STR"\t4b, 11b\n\t"              \
> -               PTR_STR"\t5b, 11b\n\t"              \
> -               PTR_STR"\t6b, 11b\n\t"              \
> -               PTR_STR"\t7b, 11b\n\t"              \
> -               PTR_STR"\t8b, 11b\n\t"              \
> +               INST_PTR_STR"\t1b, 11b\n\t"         \
> +               INST_PTR_STR"\t2b, 11b\n\t"         \
> +               INST_PTR_STR"\t3b, 11b\n\t"         \
> +               INST_PTR_STR"\t4b, 11b\n\t"         \
> +               INST_PTR_STR"\t5b, 11b\n\t"         \
> +               INST_PTR_STR"\t6b, 11b\n\t"         \
> +               INST_PTR_STR"\t7b, 11b\n\t"         \
> +               INST_PTR_STR"\t8b, 11b\n\t"         \
>                 ".previous"                         \
>                 : "=&r" (res)                               \
>                 : "r" (value), "r" (addr), "i" (-EFAULT)    \
> --
> 2.1.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF
  2020-05-29  1:24 ` Huacai Chen
@ 2020-05-29  7:56   ` Thomas Bogendoerfer
  2020-05-29  8:23     ` Huacai Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Bogendoerfer @ 2020-05-29  7:56 UTC (permalink / raw)
  To: Huacai Chen; +Cc: Tiezhu Yang, open list:MIPS, LKML, Xuefeng Li

On Fri, May 29, 2020 at 09:24:06AM +0800, Huacai Chen wrote:
> Hi, Tiezhu,
> 
> On Thu, May 28, 2020 at 4:28 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> >
> > Replace PTR_STR with INST_PTR_STR to fix the following build warning when
> > CONFIG_TEST_PRINTF is set:
> >
> >   CC      lib/test_printf.o
> > lib/test_printf.c:214:0: warning: "PTR_STR" redefined
> >  #define PTR_STR "ffff0123456789ab"
> >  ^
> > In file included from ./arch/mips/include/asm/dsemul.h:11:0,
> >                  from ./arch/mips/include/asm/processor.h:22,
> >                  from ./arch/mips/include/asm/thread_info.h:16,
> >                  from ./include/linux/thread_info.h:38,
> >                  from ./include/asm-generic/preempt.h:5,
> >                  from ./arch/mips/include/generated/asm/preempt.h:1,
> >                  from ./include/linux/preempt.h:78,
> >                  from ./include/linux/spinlock.h:51,
> >                  from ./include/linux/seqlock.h:36,
> >                  from ./include/linux/time.h:6,
> >                  from ./include/linux/stat.h:19,
> >                  from ./include/linux/module.h:13,
> >                  from lib/test_printf.c:10:
> > ./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition
> >  #define PTR_STR  ".dword"
> >  ^
> >
> > Fixes: e701656ec4db ("MIPS: inst.h: Stop including asm.h to avoid various build failures")
> > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> Thank you for catching this issue, but I think this is not the best
> solution. Maciej suggest another solution, and I will send a patch to
> fix it.

thank you, I was about to fix it myself. Not sure about your plan,
but my idea would be to move the unaligned stuff into it's another
or a new header file.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF
  2020-05-29  7:56   ` Thomas Bogendoerfer
@ 2020-05-29  8:23     ` Huacai Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Huacai Chen @ 2020-05-29  8:23 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: Tiezhu Yang, open list:MIPS, LKML, Xuefeng Li

Hi, Thomas,

On Fri, May 29, 2020 at 4:05 PM Thomas Bogendoerfer
<tsbogend@alpha.franken.de> wrote:
>
> On Fri, May 29, 2020 at 09:24:06AM +0800, Huacai Chen wrote:
> > Hi, Tiezhu,
> >
> > On Thu, May 28, 2020 at 4:28 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
> > >
> > > Replace PTR_STR with INST_PTR_STR to fix the following build warning when
> > > CONFIG_TEST_PRINTF is set:
> > >
> > >   CC      lib/test_printf.o
> > > lib/test_printf.c:214:0: warning: "PTR_STR" redefined
> > >  #define PTR_STR "ffff0123456789ab"
> > >  ^
> > > In file included from ./arch/mips/include/asm/dsemul.h:11:0,
> > >                  from ./arch/mips/include/asm/processor.h:22,
> > >                  from ./arch/mips/include/asm/thread_info.h:16,
> > >                  from ./include/linux/thread_info.h:38,
> > >                  from ./include/asm-generic/preempt.h:5,
> > >                  from ./arch/mips/include/generated/asm/preempt.h:1,
> > >                  from ./include/linux/preempt.h:78,
> > >                  from ./include/linux/spinlock.h:51,
> > >                  from ./include/linux/seqlock.h:36,
> > >                  from ./include/linux/time.h:6,
> > >                  from ./include/linux/stat.h:19,
> > >                  from ./include/linux/module.h:13,
> > >                  from lib/test_printf.c:10:
> > > ./arch/mips/include/asm/inst.h:20:0: note: this is the location of the previous definition
> > >  #define PTR_STR  ".dword"
> > >  ^
> > >
> > > Fixes: e701656ec4db ("MIPS: inst.h: Stop including asm.h to avoid various build failures")
> > > Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> > Thank you for catching this issue, but I think this is not the best
> > solution. Maciej suggest another solution, and I will send a patch to
> > fix it.
>
> thank you, I was about to fix it myself. Not sure about your plan,
> but my idea would be to move the unaligned stuff into it's another
> or a new header file.
Yes, this is also Maciej's suggestion, and I have sent the patch one
minute ago...

Huacai
>
> Thomas.
>
> --
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-29  8:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  8:27 [PATCH] MIPS: Fix build warning about "PTR_STR" redefined under CONFIG_TEST_PRINTF Tiezhu Yang
2020-05-29  1:24 ` Huacai Chen
2020-05-29  7:56   ` Thomas Bogendoerfer
2020-05-29  8:23     ` Huacai Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).