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>
This commit is contained in:
Tristan Shieh 2018-06-06 12:52:20 +08:00 committed by Patrick Georgi
parent 794284ff0e
commit f42db110d0
17 changed files with 59 additions and 52 deletions

View file

@ -306,8 +306,9 @@ struct disp_ovl_regs {
};
check_member(disp_ovl_regs, l3_addr, 0xFA0);
static struct disp_ovl_regs * const disp_ovl[2] =
{(void *) DIS_OVL0_BASE, (void *) DIS_OVL1_BASE};
static struct disp_ovl_regs *const disp_ovl[2] = {
(void *)DIS_OVL0_BASE, (void *)DIS_OVL1_BASE
};
struct disp_rdma_regs {
u32 int_enable;
@ -341,8 +342,11 @@ enum {
};
check_member(disp_rdma_regs, debug_out_sel, 0x94);
static struct disp_rdma_regs * const disp_rdma[3] =
{(void *)DISP_RDMA0_BASE, (void *)DISP_RDMA1_BASE, (void *)DISP_RDMA2_BASE};
static struct disp_rdma_regs *const disp_rdma[3] = {
(void *)DISP_RDMA0_BASE,
(void *)DISP_RDMA1_BASE,
(void *)DISP_RDMA2_BASE
};
struct disp_od_regs {
u32 en;
@ -423,8 +427,9 @@ check_member(disp_color_regs, cfg_main, 0x400);
check_member(disp_color_regs, start, 0xC00);
check_member(disp_color_regs, width, 0xC50);
check_member(disp_color_regs, height, 0xC54);
static struct disp_color_regs * const disp_color[2] =
{(void *)DISP_COLOR0_BASE, (void *)DISP_COLOR1_BASE};
static struct disp_color_regs *const disp_color[2] = {
(void *)DISP_COLOR0_BASE, (void *)DISP_COLOR1_BASE
};
enum {
COLOR_BYPASS_ALL = BIT(7),

View file

@ -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 unsigned int uartclk = 26 * MHz;
const unsigned int baudrate = get_uart_baudrate();
const uint8_t line_config = UART8250_LCR_WLS_8; /* 8n1 */
unsigned highspeed, quot, divisor, remainder;
unsigned int highspeed, quot, divisor, remainder;
if (baudrate <= 115200) {
highspeed = 0;
@ -130,13 +130,15 @@ static void mtk_uart_init(void)
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)