Skip to contentSkip to conversation

MIPS: drop redundant debug_ll_outhexw macro defines

PATCH Applied Antony Pavlov 2 participants 2 messages Jan 9, 2017 – Jan 10, 2017 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: drop redundant debug_ll_outhexw macro defines

The debug_ll_outhexw macro has no dependency on UART model so we can remove it from UART-dependent header files (debug_ll_ns16550.h and mach-ath79/.../debug_ll.h).

On the other hand the only debug_ll_outhexw user is MIPS nmon monitor so we can move the debug_ll_outhexw macro to pbl_nmon.h.

---
 arch/mips/include/asm/debug_ll_ns16550.h     | 32 ----------------------------
 arch/mips/include/asm/pbl_nmon.h             | 31 +++++++++++++++++++++++++++
 arch/mips/mach-ath79/include/mach/debug_ll.h | 32 ----------------------------
 3 files changed, 31 insertions(+), 64 deletions(-)
arch/mips/include/asm/debug_ll_ns16550.h +0 -32
index 4a6562f7c..058814ecf 100644
@@ -128,38 +128,6 @@ static inline void PUTC_LL(char ch)
 .endm
 
 /*
- * output a 32-bit value in hex
- */
-.macro debug_ll_outhexw
-#ifdef CONFIG_DEBUG_LL
-	.set	push
-	.set	reorder
-
-	move	t6, a0
-	li		t5, 32
-
-202:
-	addi	t5, t5, -4
-	srlv	a0, t6, t5
-
-	/* output one hex digit */
-	andi	a0, a0, 15
-	blt	a0, 10, 203f
-
-	addi	a0, a0, ('a' - '9' - 1)
-
-203:
-	addi	a0, a0, '0'
-
-	debug_ll_outc_a0
-
-	bgtz	t5, 202b
-
-	.set	pop
-#endif /* CONFIG_DEBUG_LL */
-.endm
-
-/*
  * check character in input buffer
  * return value:
  *  v0 = 0   no character in input buffer
arch/mips/include/asm/pbl_nmon.h +31 -0
index 90e2da8ef..e0326bd7c 100644
@@ -43,6 +43,37 @@
 	.set	pop
 	.endm
 
+/*
+ * output a 32-bit value in hex
+ */
+.macro debug_ll_outhexw
+#ifdef CONFIG_DEBUG_LL
+	.set	push
+	.set	reorder
+
+	move	t6, a0
+	li	t5, 32
+
+202:
+	addi	t5, t5, -4
+	srlv	a0, t6, t5
+
+	/* output one hex digit */
+	andi	a0, a0, 15
+	blt	a0, 10, 203f
+
+	addi	a0, a0, ('a' - '9' - 1)
+
+203:
+	addi	a0, a0, '0'
+
+	debug_ll_outc_a0
+
+	bgtz	t5, 202b
+
+	.set	pop
+#endif /* CONFIG_DEBUG_LL */
+.endm
 
 	.macro	mips_nmon
 	.set	push
arch/mips/mach-ath79/include/mach/debug_ll.h +0 -32
index e0c3f797b..04bd3ea72 100644
@@ -123,38 +123,6 @@ static inline void PUTC_LL(int ch)
 .endm
 
 /*
- * output a 32-bit value in hex
- */
-.macro debug_ll_outhexw
-#ifdef CONFIG_DEBUG_LL
-	.set	push
-	.set	reorder
-
-	move	t6, a0
-	li		t5, 32
-
-202:
-	addi	t5, t5, -4
-	srlv	a0, t6, t5
-
-	/* output one hex digit */
-	andi	a0, a0, 15
-	blt	a0, 10, 203f
-
-	addi	a0, a0, ('a' - '9' - 1)
-
-203:
-	addi	a0, a0, '0'
-
-	debug_ll_outc_a0
-
-	bgtz	t5, 202b
-
-	.set	pop
-#endif /* CONFIG_DEBUG_LL */
-.endm
-
-/*
  * check character in input buffer
  * return value:
  *  v0 = 0   no character in input buffer
Signature · 7 lines
2.11.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Antony Pavlov

The debug_ll_outhexw macro has no dependency on UART model so we can remove it from UART-dependent header files (debug_ll_ns16550.h and mach-ath79/.../debug_ll.h).

On the other hand the only debug_ll_outhexw user is MIPS nmon monitor so we can move the debug_ll_outhexw macro to pbl_nmon.h.

Applied, thanks

Sascha

Quoted 138 lines
---
 arch/mips/include/asm/debug_ll_ns16550.h     | 32 ----------------------------
 arch/mips/include/asm/pbl_nmon.h             | 31 +++++++++++++++++++++++++++
 arch/mips/mach-ath79/include/mach/debug_ll.h | 32 ----------------------------
 3 files changed, 31 insertions(+), 64 deletions(-)
arch/mips/include/asm/debug_ll_ns16550.h +0 -32
index 4a6562f7c..058814ecf 100644
@@ -128,38 +128,6 @@ static inline void PUTC_LL(char ch)
 .endm
 
 /*
- * output a 32-bit value in hex
- */
-.macro debug_ll_outhexw
-#ifdef CONFIG_DEBUG_LL
-	.set	push
-	.set	reorder
-
-	move	t6, a0
-	li		t5, 32
-
-202:
-	addi	t5, t5, -4
-	srlv	a0, t6, t5
-
-	/* output one hex digit */
-	andi	a0, a0, 15
-	blt	a0, 10, 203f
-
-	addi	a0, a0, ('a' - '9' - 1)
-
-203:
-	addi	a0, a0, '0'
-
-	debug_ll_outc_a0
-
-	bgtz	t5, 202b
-
-	.set	pop
-#endif /* CONFIG_DEBUG_LL */
-.endm
-
-/*
  * check character in input buffer
  * return value:
  *  v0 = 0   no character in input buffer
arch/mips/include/asm/pbl_nmon.h +31 -0
index 90e2da8ef..e0326bd7c 100644
@@ -43,6 +43,37 @@
 	.set	pop
 	.endm
 
+/*
+ * output a 32-bit value in hex
+ */
+.macro debug_ll_outhexw
+#ifdef CONFIG_DEBUG_LL
+	.set	push
+	.set	reorder
+
+	move	t6, a0
+	li	t5, 32
+
+202:
+	addi	t5, t5, -4
+	srlv	a0, t6, t5
+
+	/* output one hex digit */
+	andi	a0, a0, 15
+	blt	a0, 10, 203f
+
+	addi	a0, a0, ('a' - '9' - 1)
+
+203:
+	addi	a0, a0, '0'
+
+	debug_ll_outc_a0
+
+	bgtz	t5, 202b
+
+	.set	pop
+#endif /* CONFIG_DEBUG_LL */
+.endm
 
 	.macro	mips_nmon
 	.set	push
arch/mips/mach-ath79/include/mach/debug_ll.h +0 -32
index e0c3f797b..04bd3ea72 100644
@@ -123,38 +123,6 @@ static inline void PUTC_LL(int ch)
 .endm
 
 /*
- * output a 32-bit value in hex
- */
-.macro debug_ll_outhexw
-#ifdef CONFIG_DEBUG_LL
-	.set	push
-	.set	reorder
-
-	move	t6, a0
-	li		t5, 32
-
-202:
-	addi	t5, t5, -4
-	srlv	a0, t6, t5
-
-	/* output one hex digit */
-	andi	a0, a0, 15
-	blt	a0, 10, 203f
-
-	addi	a0, a0, ('a' - '9' - 1)
-
-203:
-	addi	a0, a0, '0'
-
-	debug_ll_outc_a0
-
-	bgtz	t5, 202b
-
-	.set	pop
-#endif /* CONFIG_DEBUG_LL */
-.endm
-
-/*
  * check character in input buffer
  * return value:
  *  v0 = 0   no character in input buffer
Signature · 1 line
2.11.0
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox