diff mbox

[U-Boot] debug_uart: Try not to use stack in printch

Message ID 1491492761-15722-1-git-send-email-tim.chick@mediatek.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

tim.chick April 6, 2017, 3:32 p.m. UTC
Spam detection software, running on the system "lists.denx.de",
has identified this incoming email as possible spam.  The original
message has been attached to this so you can view it or label
similar future email.  If you have any questions, see
@@CONTACT_ADDRESS@@ for details.

Content preview:  Previous change to create _printch causes the stack to be
  used, breaking printch before stack is available. Inline _printch to prevent
   this happening. Signed-off-by: Tim Chick <tim.chick@mediatek.com> --- [...]
   

Content analysis details:   (6.3 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 0.7 RCVD_IN_XBL            RBL: Received via a relay in Spamhaus XBL
                            [188.29.165.105 listed in zen.spamhaus.org]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 1.6 RCVD_IN_BRBL_LASTEXT   RBL: No description available.
                            [188.29.165.105 listed in bb.barracudacentral.org]
 0.4 RDNS_DYNAMIC           Delivered to internal network by host with
                            dynamic-looking rDNS
Previous change to create _printch causes the stack to be used,
breaking printch before stack is available. Inline _printch to
prevent this happening.

Signed-off-by: Tim Chick <tim.chick@mediatek.com>
---

 include/debug_uart.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Tom Rini April 14, 2017, 9:09 p.m. UTC | #1
On Thu, Apr 06, 2017 at 04:32:41PM +0100, tim.chick wrote:

> Spam detection software, running on the system "lists.denx.de",
> has identified this incoming email as possible spam.  The original
> message has been attached to this so you can view it or label
> similar future email.  If you have any questions, see
> @@CONTACT_ADDRESS@@ for details.
> 
> Content preview:  Previous change to create _printch causes the stack to be
>   used, breaking printch before stack is available. Inline _printch to prevent
>    this happening. Signed-off-by: Tim Chick <tim.chick@mediatek.com> --- [...]
>    
> 
> Content analysis details:   (6.3 points, 5.0 required)
> 
>  pts rule name              description

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/include/debug_uart.h b/include/debug_uart.h
index 0d640b9..2980ae6 100644
--- a/include/debug_uart.h
+++ b/include/debug_uart.h
@@ -115,17 +115,23 @@  void printhex8(uint value);
  * Now define some functions - this should be inserted into the serial driver
  */
 #define DEBUG_UART_FUNCS \
-	void printch(int ch) \
+\
+	static inline void _printch(int ch) \
 	{ \
 		if (ch == '\n') \
 			_debug_uart_putc('\r'); \
 		_debug_uart_putc(ch); \
 	} \
 \
+	void printch(int ch) \
+	{ \
+		_printch(ch); \
+	} \
+\
 	void printascii(const char *str) \
 	{ \
 		while (*str) \
-			printch(*str++); \
+			_printch(*str++); \
 	} \
 \
 	static inline void printhex1(uint digit) \