Skip to content

Commit 9ca06c0

Browse files
committed
drivers: tty: serial: cpm_uart: fix styling issues
Fix checkpatch errors: ERROR: else should follow close brace '}' torvalds#121: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:121: + } + else WARNING: line over 80 characters torvalds#150: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c:150: + pinfo->tx_fifosize), (void __force *)pinfo->mem_addr, WARNING: Block comments should align the * on each line torvalds#66: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:66: + * Check, if transmit buffers are processed +*/ WARNING: braces {} are not necessary for any arm of this statement torvalds#170: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:170: + if (IS_SMC(pinfo)) { [...] + } else { [...] WARNING: labels should not be indented torvalds#292: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:292: + error_return: ERROR: code indent should use tabs where possible torvalds#299: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:299: +^I^I BD_SC_OV | BD_SC_ID);$ WARNING: labels should not be indented torvalds#319: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:319: + handle_error: WARNING: line over 80 characters torvalds#423: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:423: + setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT)); ERROR: space required before the open parenthesis '(' torvalds#451: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:451: + while(!cpm_uart_tx_empty(port)) { WARNING: Missing a blank line after declarations torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462: + smc_t __iomem *smcp = pinfo->smcp; + clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN); WARNING: line over 80 characters torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466: + clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); WARNING: Missing a blank line after declarations torvalds#466: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:466: + scc_t __iomem *sccp = pinfo->sccp; + clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); ERROR: code indent should use tabs where possible torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484: + struct ktermios *termios,$ WARNING: please, no spaces at the start of a line torvalds#484: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:484: + struct ktermios *termios,$ ERROR: code indent should use tabs where possible torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485: + struct ktermios *old)$ WARNING: please, no spaces at the start of a line torvalds#485: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:485: + struct ktermios *old)$ WARNING: line over 80 characters torvalds#624: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:624: + /* Output in *one* operation, so we don't interrupt RX/TX if they WARNING: Block comments use a trailing */ on a separate line torvalds#625: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:625: + * were already enabled. */ WARNING: line over 80 characters torvalds#629: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:629: + out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize); WARNING: line over 80 characters torvalds#773: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:773: + mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize); ERROR: code indent should use tabs where possible torvalds#797: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:797: +^I (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible torvalds#799: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:799: +^I (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible torvalds#836: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:836: +^I SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);$ ERROR: code indent should use tabs where possible torvalds#859: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:859: +^I (u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);$ ERROR: code indent should use tabs where possible torvalds#861: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:861: +^I (u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);$ WARNING: space prohibited between function name and open parenthesis '(' torvalds#866: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:866: +#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH) WARNING: line over 80 characters torvalds#921: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:921: + clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); WARNING: Missing a blank line after declarations torvalds#462: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:462: + smc_t __iomem *smcp = pinfo->smcp; + clrbits16(&smcp->smc_smcmr, WARNING: Missing a blank line after declarations torvalds#467: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:467: + scc_t __iomem *sccp = pinfo->sccp; + clrbits32(&sccp->scc_gsmrl, ERROR: code indent should use tabs where possible torvalds#1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line torvalds#1151: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1151: + struct uart_cpm_port *pinfo)$ ERROR: "(foo*)" should be "(foo *)" torvalds#1161: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1161: + struct clk *clk = clk_get(NULL, (const char*)data); WARNING: Missing a blank line after declarations torvalds#1162: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1162: + struct clk *clk = clk_get(NULL, (const char*)data); + if (!IS_ERR(clk)) ERROR: code indent should use tabs where possible #1169: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1169: +^I^I^I "fsl,cpm-brg property.\n", np);$ ERROR: code indent should use tabs where possible #1178: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1178: +^I^I "fsl,cpm-command property.\n", np);$ ERROR: code indent should use tabs where possible #1192: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1192: WARNING: braces {} are not necessary for any arm of this statement #1279: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1279: + if (unlikely(nolock)) { [...] + } else { [...] WARNING: braces {} are not necessary for any arm of this statement #1287: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1287: + if (unlikely(nolock)) { [...] + } else { [...] WARNING: line over 80 characters #1354: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1354: + clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); ERROR: Macros with complex values should be enclosed in parentheses #1394: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1394: +#define CPM_UART_CONSOLE &cpm_scc_uart_console WARNING: Missing a blank line after declarations #1437: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1437: + struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev); + return uart_remove_one_port(&cpm_reg, &pinfo->port); WARNING: please, no spaces at the start of a line #1464: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1464: + };$ WARNING: Missing a blank line after declarations #1469: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1469: + int ret = uart_register_driver(&cpm_reg); + if (ret) WARNING: Missing a blank line after declarations torvalds#1062: FILE: drivers/tty/serial/cpm_uart/cpm_uart_core.c:1062: + int i; + volatile cbd_t *bdp; ERROR: "foo * bar" should be "foo *bar" torvalds#19: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:19: +static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup) ERROR: "foo * bar" should be "foo *bar" torvalds#25: FILE: drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h:25: +static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up) WARNING: Improper SPDX comment style for 'drivers/tty/serial/cpm_uart/cpm_uart.h', please use '/*' instead #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #1: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Block comments use * on subsequent lines torvalds#106: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:106: +/* + virtual to phys transtalion ERROR: code indent should use tabs where possible torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line torvalds#109: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:109: + struct uart_cpm_port *pinfo)$ ERROR: code indent should use tabs where possible torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125: + struct uart_cpm_port *pinfo)$ WARNING: please, no spaces at the start of a line torvalds#125: FILE: drivers/tty/serial/cpm_uart/cpm_uart.h:125: + struct uart_cpm_port *pinfo)$ Signed-off-by: Enrico Weigelt <[email protected]>
1 parent fef8ae6 commit 9ca06c0

File tree

4 files changed

+64
-51
lines changed

4 files changed

+64
-51
lines changed

drivers/tty/serial/cpm_uart/cpm_uart.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-License-Identifier: GPL-2.0
1+
/* SPDX-License-Identifier: GPL-2.0 */
22
/*
33
* Driver for CPM (SCC/SMC) serial ports
44
*
@@ -103,10 +103,10 @@ void scc3_lineif(struct uart_cpm_port *pinfo);
103103
void scc4_lineif(struct uart_cpm_port *pinfo);
104104

105105
/*
106-
virtual to phys transtalion
107-
*/
106+
* virtual to phys transtalion
107+
*/
108108
static inline unsigned long cpu2cpm_addr(void *addr,
109-
struct uart_cpm_port *pinfo)
109+
struct uart_cpm_port *pinfo)
110110
{
111111
int offset;
112112
u32 val = (u32)addr;
@@ -122,7 +122,7 @@ static inline unsigned long cpu2cpm_addr(void *addr,
122122
}
123123

124124
static inline void *cpm2cpu_addr(unsigned long addr,
125-
struct uart_cpm_port *pinfo)
125+
struct uart_cpm_port *pinfo)
126126
{
127127
int offset;
128128
u32 val = addr;

drivers/tty/serial/cpm_uart/cpm_uart_core.c

+54-41
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo);
6363

6464
/*
6565
* Check, if transmit buffers are processed
66-
*/
66+
*/
6767
static unsigned int cpm_uart_tx_empty(struct uart_port *port)
6868
{
6969
struct uart_cpm_port *pinfo =
@@ -167,11 +167,10 @@ static void cpm_uart_start_tx(struct uart_port *port)
167167
}
168168

169169
if (cpm_uart_tx_pump(port) != 0) {
170-
if (IS_SMC(pinfo)) {
170+
if (IS_SMC(pinfo))
171171
setbits8(&smcp->smc_smcm, SMCM_TX);
172-
} else {
172+
else
173173
setbits16(&sccp->scc_sccm, UART_SCCM_TX);
174-
}
175174
}
176175
}
177176

@@ -289,14 +288,14 @@ static void cpm_uart_int_rx(struct uart_port *port)
289288
return;
290289
}
291290
#endif
292-
error_return:
291+
error_return:
293292
tty_insert_flip_char(tport, ch, flg);
294293

295294
} /* End while (i--) */
296295

297296
/* This BD is ready to be used again. Clear status. get next */
298297
clrbits16(&bdp->cbd_sc, BD_SC_BR | BD_SC_FR | BD_SC_PR |
299-
BD_SC_OV | BD_SC_ID);
298+
BD_SC_OV | BD_SC_ID);
300299
setbits16(&bdp->cbd_sc, BD_SC_EMPTY);
301300

302301
if (in_be16(&bdp->cbd_sc) & BD_SC_WRAP)
@@ -316,7 +315,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
316315

317316
/* Error processing */
318317

319-
handle_error:
318+
handle_error:
320319
/* Statistics */
321320
if (status & BD_SC_BR)
322321
port->icount.brk++;
@@ -420,7 +419,8 @@ static int cpm_uart_startup(struct uart_port *port)
420419
setbits16(&pinfo->smcp->smc_smcmr, (SMCMR_REN | SMCMR_TEN));
421420
} else {
422421
setbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
423-
setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
422+
setbits32(&pinfo->sccp->scc_gsmrl,
423+
(SCC_GSMRL_ENR | SCC_GSMRL_ENT));
424424
}
425425

426426
return 0;
@@ -448,7 +448,7 @@ static void cpm_uart_shutdown(struct uart_port *port)
448448
/* If the port is not the console, disable Rx and Tx. */
449449
if (!(pinfo->flags & FLAG_CONSOLE)) {
450450
/* Wait for all the BDs marked sent */
451-
while(!cpm_uart_tx_empty(port)) {
451+
while (!cpm_uart_tx_empty(port)) {
452452
set_current_state(TASK_UNINTERRUPTIBLE);
453453
schedule_timeout(2);
454454
}
@@ -459,12 +459,17 @@ static void cpm_uart_shutdown(struct uart_port *port)
459459
/* Stop uarts */
460460
if (IS_SMC(pinfo)) {
461461
smc_t __iomem *smcp = pinfo->smcp;
462-
clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
462+
463+
clrbits16(&smcp->smc_smcmr,
464+
SMCMR_REN | SMCMR_TEN);
463465
clrbits8(&smcp->smc_smcm, SMCM_RX | SMCM_TX);
464466
} else {
465467
scc_t __iomem *sccp = pinfo->sccp;
466-
clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
467-
clrbits16(&sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
468+
469+
clrbits32(&sccp->scc_gsmrl,
470+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
471+
clrbits16(&sccp->scc_sccm,
472+
UART_SCCM_TX | UART_SCCM_RX);
468473
}
469474

470475
/* Shut them really down and reinit buffer descriptors */
@@ -481,8 +486,8 @@ static void cpm_uart_shutdown(struct uart_port *port)
481486
}
482487

483488
static void cpm_uart_set_termios(struct uart_port *port,
484-
struct ktermios *termios,
485-
struct ktermios *old)
489+
struct ktermios *termios,
490+
struct ktermios *old)
486491
{
487492
int baud;
488493
unsigned long flags;
@@ -621,12 +626,14 @@ static void cpm_uart_set_termios(struct uart_port *port,
621626
* present.
622627
*/
623628
prev_mode = in_be16(&smcp->smc_smcmr) & (SMCMR_REN | SMCMR_TEN);
624-
/* Output in *one* operation, so we don't interrupt RX/TX if they
625-
* were already enabled. */
629+
/* Output in *one* operation, so we don't interrupt RX/TX if
630+
* they were already enabled.
631+
*/
626632
out_be16(&smcp->smc_smcmr, smcr_mk_clen(bits) | cval |
627633
SMCMR_SM_UART | prev_mode);
628634
} else {
629-
out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);
635+
out_be16(&pinfo->sccup->scc_genscc.scc_mrblr,
636+
pinfo->rx_fifosize);
630637
out_be16(&pinfo->sccup->scc_maxidl, maxidl);
631638
out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
632639
}
@@ -770,7 +777,8 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
770777
* buffers in the buffer descriptors, and the
771778
* virtual address for us to work with.
772779
*/
773-
mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
780+
mem_addr = pinfo->mem_addr +
781+
L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
774782
bdp = pinfo->tx_cur = pinfo->tx_bd_base;
775783
for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
776784
out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
@@ -794,9 +802,9 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
794802

795803
/* Store address */
796804
out_be16(&pinfo->sccup->scc_genscc.scc_rbase,
797-
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
805+
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
798806
out_be16(&pinfo->sccup->scc_genscc.scc_tbase,
799-
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
807+
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
800808

801809
/* Set up the uart parameters in the
802810
* parameter ram.
@@ -833,7 +841,7 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
833841
*/
834842
out_be32(&scp->scc_gsmrh, 0);
835843
out_be32(&scp->scc_gsmrl,
836-
SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
844+
SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
837845

838846
/* Enable rx interrupts and clear all pending events. */
839847
out_be16(&scp->scc_sccm, 0);
@@ -856,14 +864,14 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
856864

857865
/* Store address */
858866
out_be16(&pinfo->smcup->smc_rbase,
859-
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
867+
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
860868
out_be16(&pinfo->smcup->smc_tbase,
861-
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
869+
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
862870

863871
/*
864872
* In case SMC1 is being relocated...
865873
*/
866-
#if defined (CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
874+
#if defined(CONFIG_I2C_SPI_SMC1_UCODE_PATCH)
867875
out_be16(&up->smc_rbptr, in_be16(&pinfo->smcup->smc_rbase));
868876
out_be16(&up->smc_tbptr, in_be16(&pinfo->smcup->smc_tbase));
869877
out_be32(&up->smc_rstate, 0);
@@ -917,8 +925,10 @@ static int cpm_uart_request_port(struct uart_port *port)
917925
clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX | SMCM_TX);
918926
clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
919927
} else {
920-
clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
921-
clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
928+
clrbits16(&pinfo->sccp->scc_sccm,
929+
UART_SCCM_TX | UART_SCCM_RX);
930+
clrbits32(&pinfo->sccp->scc_gsmrl,
931+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
922932
}
923933

924934
ret = cpm_uart_allocbuf(pinfo, 0);
@@ -1048,9 +1058,10 @@ static int poll_chars;
10481058
static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)
10491059
{
10501060
u_char c, *cp;
1051-
volatile cbd_t *bdp;
10521061
int i;
10531062

1063+
volatile cbd_t *bdp;
1064+
10541065
/* Get the address of the host memory buffer.
10551066
*/
10561067
bdp = pinfo->rx_cur;
@@ -1138,7 +1149,7 @@ static const struct uart_ops cpm_uart_pops = {
11381149
struct uart_cpm_port cpm_uart_ports[UART_NR];
11391150

11401151
static int cpm_uart_init_port(struct device_node *np,
1141-
struct uart_cpm_port *pinfo)
1152+
struct uart_cpm_port *pinfo)
11421153
{
11431154
const u32 *data;
11441155
void __iomem *mem, *pram;
@@ -1148,15 +1159,16 @@ static int cpm_uart_init_port(struct device_node *np,
11481159

11491160
data = of_get_property(np, "clock", NULL);
11501161
if (data) {
1151-
struct clk *clk = clk_get(NULL, (const char*)data);
1162+
struct clk *clk = clk_get(NULL, (const char *)data);
1163+
11521164
if (!IS_ERR(clk))
11531165
pinfo->clk = clk;
11541166
}
11551167
if (!pinfo->clk) {
11561168
data = of_get_property(np, "fsl,cpm-brg", &len);
11571169
if (!data || len != 4) {
11581170
dev_err(port->dev, "CPM UART %pOFn has no/invalid "
1159-
"fsl,cpm-brg property.\n", np);
1171+
"fsl,cpm-brg property.\n", np);
11601172
return -EINVAL;
11611173
}
11621174
pinfo->brg = *data;
@@ -1165,7 +1177,7 @@ static int cpm_uart_init_port(struct device_node *np,
11651177
data = of_get_property(np, "fsl,cpm-command", &len);
11661178
if (!data || len != 4) {
11671179
dev_err(port->dev, "CPM UART %pOFn has no/invalid "
1168-
"fsl,cpm-command property.\n", np);
1180+
"fsl,cpm-command property.\n", np);
11691181
return -EINVAL;
11701182
}
11711183
pinfo->command = *data;
@@ -1179,7 +1191,7 @@ static int cpm_uart_init_port(struct device_node *np,
11791191
pinfo->sccp = mem;
11801192
pinfo->sccup = pram = cpm_uart_map_pram(pinfo, np);
11811193
} else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") ||
1182-
of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
1194+
of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
11831195
pinfo->flags |= FLAG_SMC;
11841196
pinfo->smcp = mem;
11851197
pinfo->smcup = pram = cpm_uart_map_pram(pinfo, np);
@@ -1266,19 +1278,17 @@ static void cpm_uart_console_write(struct console *co, const char *s,
12661278
unsigned long flags;
12671279
int nolock = oops_in_progress;
12681280

1269-
if (unlikely(nolock)) {
1281+
if (unlikely(nolock))
12701282
local_irq_save(flags);
1271-
} else {
1283+
else
12721284
spin_lock_irqsave(&pinfo->port.lock, flags);
1273-
}
12741285

12751286
cpm_uart_early_write(pinfo, s, count, true);
12761287

1277-
if (unlikely(nolock)) {
1288+
if (unlikely(nolock))
12781289
local_irq_restore(flags);
1279-
} else {
1290+
else
12801291
spin_unlock_irqrestore(&pinfo->port.lock, flags);
1281-
}
12821292
}
12831293

12841294

@@ -1341,7 +1351,8 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
13411351
out_be16(&pinfo->sccup->scc_brkcr, 0);
13421352
cpm_line_cr_cmd(pinfo, CPM_CR_GRA_STOP_TX);
13431353
clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
1344-
clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
1354+
clrbits32(&pinfo->sccp->scc_gsmrl,
1355+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
13451356
}
13461357

13471358
ret = cpm_uart_allocbuf(pinfo, 1);
@@ -1381,7 +1392,7 @@ static int __init cpm_uart_console_init(void)
13811392

13821393
console_initcall(cpm_uart_console_init);
13831394

1384-
#define CPM_UART_CONSOLE &cpm_scc_uart_console
1395+
#define CPM_UART_CONSOLE (&cpm_scc_uart_console)
13851396
#else
13861397
#define CPM_UART_CONSOLE NULL
13871398
#endif
@@ -1424,6 +1435,7 @@ static int cpm_uart_probe(struct platform_device *ofdev)
14241435
static int cpm_uart_remove(struct platform_device *ofdev)
14251436
{
14261437
struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
1438+
14271439
return uart_remove_one_port(&cpm_reg, &pinfo->port);
14281440
}
14291441

@@ -1451,11 +1463,12 @@ static struct platform_driver cpm_uart_driver = {
14511463
},
14521464
.probe = cpm_uart_probe,
14531465
.remove = cpm_uart_remove,
1454-
};
1466+
};
14551467

14561468
static int __init cpm_uart_init(void)
14571469
{
14581470
int ret = uart_register_driver(&cpm_reg);
1471+
14591472
if (ret)
14601473
return ret;
14611474

drivers/tty/serial/cpm_uart/cpm_uart_cpm1.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ static inline void cpm_set_brg(int brg, int baud)
1616
cpm_setbrg(brg, baud);
1717
}
1818

19-
static inline void cpm_set_scc_fcr(scc_uart_t __iomem * sup)
19+
static inline void cpm_set_scc_fcr(scc_uart_t __iomem *sup)
2020
{
2121
out_8(&sup->scc_genscc.scc_rfcr, SMC_EB);
2222
out_8(&sup->scc_genscc.scc_tfcr, SMC_EB);
2323
}
2424

25-
static inline void cpm_set_smc_fcr(smc_uart_t __iomem * up)
25+
static inline void cpm_set_smc_fcr(smc_uart_t __iomem *up)
2626
{
2727
out_8(&up->smc_rfcr, SMC_EB);
2828
out_8(&up->smc_tfcr, SMC_EB);

drivers/tty/serial/cpm_uart/cpm_uart_cpm2.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
117117
if (is_con) {
118118
mem_addr = kzalloc(memsz, GFP_NOWAIT);
119119
dma_addr = virt_to_bus(mem_addr);
120-
}
121-
else
120+
} else
122121
mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
123122
GFP_KERNEL);
124123

@@ -148,7 +147,8 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
148147
dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
149148
pinfo->rx_fifosize) +
150149
L1_CACHE_ALIGN(pinfo->tx_nrfifos *
151-
pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,
150+
pinfo->tx_fifosize),
151+
(void __force *)pinfo->mem_addr,
152152
pinfo->dma_addr);
153153

154154
cpm_dpfree(pinfo->dp_addr);

0 commit comments

Comments
 (0)