mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
driver/serial: remove return value of up_putc()
modify the prototype of up_putc(): remove the return value
The architecture code does not care about the return value of up_putc(), so removing it saves two statements:
Before: After:
de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!) | de4c: e52de004 push {lr} @ (str lr, [sp, #-4]!)
de50: e24dd014 sub sp, sp, #20 | de50: e24dd014 sub sp, sp, #20
de54: e58d0004 str r0, [sp, #4] | de54: e58d0004 str r0, [sp, #4]
de58: e30030f8 movw r3, #248 @ 0xf8 | de58: e30030f8 movw r3, #248 @ 0xf8
de5c: e3423000 movt r3, #8192 @ 0x2000 | de5c: e3423000 movt r3, #8192 @ 0x2000
de60: e58d300c str r3, [sp, #12] | de60: e58d300c str r3, [sp, #12]
de64: e59d1004 ldr r1, [sp, #4] | de64: e59d1004 ldr r1, [sp, #4]
de68: e59d000c ldr r0, [sp, #12] | de68: e59d000c ldr r0, [sp, #12]
de6c: ebfffe66 bl d80c <pl011_putc> | de6c: ebfffe66 bl d80c <pl011_putc>
de70: e59d3004 ldr r3, [sp, #4] | de70: e28dd014 add sp, sp, #20
de74: e1a00003 mov r0, r3 | de74: e49df004 pop {pc} @ (ldr pc, [sp], #4)
de78: e28dd014 add sp, sp, #20 |
de7c: e49df004 pop {pc} @ (ldr pc, [sp], #4) |
Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
@@ -870,7 +870,7 @@ void sparc_serialinit(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)&CONSOLE_DEV;
|
||||
@@ -880,7 +880,6 @@ int up_putc(int ch)
|
||||
sparc_lowputc(ch);
|
||||
up_restoreuartint(dev, imr);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -902,9 +901,8 @@ void sparc_serialinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UART_DEVICE */
|
||||
@@ -918,12 +916,11 @@ int up_putc(int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
sparc_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
@@ -865,7 +865,7 @@ void sparc_serialinit(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)&CONSOLE_DEV;
|
||||
@@ -875,7 +875,6 @@ int up_putc(int ch)
|
||||
sparc_lowputc(ch);
|
||||
up_restoreuartint(dev, imr);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -897,9 +896,8 @@ void sparc_serialinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UART_DEVICE */
|
||||
@@ -913,12 +911,11 @@ int up_putc(int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
sparc_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
@@ -951,7 +951,7 @@ void sparc_serialinit(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
struct uart_dev_s *dev = (struct uart_dev_s *)&CONSOLE_DEV;
|
||||
@@ -961,7 +961,6 @@ int up_putc(int ch)
|
||||
sparc_lowputc(ch);
|
||||
up_restoreuartint(dev, imr);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -983,9 +982,8 @@ void sparc_serialinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UART_DEVICE */
|
||||
@@ -999,12 +997,11 @@ int up_putc(int ch)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int up_putc(int ch)
|
||||
void up_putc(int ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
sparc_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
Reference in New Issue
Block a user