diff options
author | Tristan Shieh <tristan.shieh@mediatek.com> | 2018-06-06 12:52:20 +0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-06-07 07:42:43 +0000 |
commit | f42db110d0174f05745e3558067d114eae37825b (patch) | |
tree | a5a52a630e8704369f57d6d21077e95c13733cb7 /src/soc/mediatek/mt8173/uart.c | |
parent | 794284ff0ee92f7f60c4d33dbf43bf007979389c (diff) |
mediatek: Refine whitespace and formating changes
This patch fix whitespace and formating issues:
1. Using two spaces between code and single line comment.
2. No space after asterisk.
3. Fix checkpatch error.
4. Remove spaces after cast operators.
BUG=b:80501386
BRANCH=none
TEST=the refactored code works fine on the new platform (with the rest
of the patches applied) and Elm platform
Change-Id: Ib36c99b141c94220776fab606eb36af8f64f65bb
Signed-off-by: Tristan Shieh <tristan.shieh@mediatek.com>
Reviewed-on: https://review.coreboot.org/26880
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/soc/mediatek/mt8173/uart.c')
-rw-r--r-- | src/soc/mediatek/mt8173/uart.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/soc/mediatek/mt8173/uart.c b/src/soc/mediatek/mt8173/uart.c index 93625c4bfb..961e3eb9be 100644 --- a/src/soc/mediatek/mt8173/uart.c +++ b/src/soc/mediatek/mt8173/uart.c @@ -86,10 +86,10 @@ static int mtk_uart_tst_byte(void); static void mtk_uart_init(void) { /* Use a hardcoded divisor for now. */ - const unsigned uartclk = 26 * MHz; - const unsigned baudrate = get_uart_baudrate(); - const uint8_t line_config = UART8250_LCR_WLS_8; /* 8n1 */ - unsigned highspeed, quot, divisor, remainder; + const unsigned int uartclk = 26 * MHz; + const unsigned int baudrate = get_uart_baudrate(); + const uint8_t line_config = UART8250_LCR_WLS_8; /* 8n1 */ + unsigned int highspeed, quot, divisor, remainder; if (baudrate <= 115200) { highspeed = 0; @@ -124,19 +124,21 @@ static void mtk_uart_init(void) /* Enable FIFOs, and clear receive and transmit. */ write8(&uart_ptr->fcr, UART8250_FCR_FIFO_EN | UART8250_FCR_CLEAR_RCVR | - UART8250_FCR_CLEAR_XMIT); + UART8250_FCR_CLEAR_XMIT); } static void mtk_uart_tx_byte(unsigned char data) { - while (!(read8(&uart_ptr->lsr) & UART8250_LSR_THRE)); + while (!(read8(&uart_ptr->lsr) & UART8250_LSR_THRE)) + ; write8(&uart_ptr->thr, data); } static void mtk_uart_tx_flush(void) { - while (!(read8(&uart_ptr->lsr) & UART8250_LSR_TEMT)); + while (!(read8(&uart_ptr->lsr) & UART8250_LSR_TEMT)) + ; } static unsigned char mtk_uart_rx_byte(void) |