Skip to content

Commit 99040d2

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 02012f6 commit 99040d2

File tree

4 files changed

+63
-50
lines changed

4 files changed

+63
-50
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

+53-40
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++;
@@ -429,7 +428,8 @@ static int cpm_uart_startup(struct uart_port *port)
429428
setbits16(&pinfo->smcp->smc_smcmr, (SMCMR_REN | SMCMR_TEN));
430429
} else {
431430
setbits16(&pinfo->sccp->scc_sccm, UART_SCCM_RX);
432-
setbits32(&pinfo->sccp->scc_gsmrl, (SCC_GSMRL_ENR | SCC_GSMRL_ENT));
431+
setbits32(&pinfo->sccp->scc_gsmrl,
432+
(SCC_GSMRL_ENR | SCC_GSMRL_ENT));
433433
}
434434

435435
return 0;
@@ -457,7 +457,7 @@ static void cpm_uart_shutdown(struct uart_port *port)
457457
/* If the port is not the console, disable Rx and Tx. */
458458
if (!(pinfo->flags & FLAG_CONSOLE)) {
459459
/* Wait for all the BDs marked sent */
460-
while(!cpm_uart_tx_empty(port)) {
460+
while (!cpm_uart_tx_empty(port)) {
461461
set_current_state(TASK_UNINTERRUPTIBLE);
462462
schedule_timeout(2);
463463
}
@@ -468,12 +468,17 @@ static void cpm_uart_shutdown(struct uart_port *port)
468468
/* Stop uarts */
469469
if (IS_SMC(pinfo)) {
470470
smc_t __iomem *smcp = pinfo->smcp;
471-
clrbits16(&smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
471+
472+
clrbits16(&smcp->smc_smcmr,
473+
SMCMR_REN | SMCMR_TEN);
472474
clrbits8(&smcp->smc_smcm, SMCM_RX | SMCM_TX);
473475
} else {
474476
scc_t __iomem *sccp = pinfo->sccp;
475-
clrbits32(&sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
476-
clrbits16(&sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
477+
478+
clrbits32(&sccp->scc_gsmrl,
479+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
480+
clrbits16(&sccp->scc_sccm,
481+
UART_SCCM_TX | UART_SCCM_RX);
477482
}
478483

479484
/* Shut them really down and reinit buffer descriptors */
@@ -490,8 +495,8 @@ static void cpm_uart_shutdown(struct uart_port *port)
490495
}
491496

492497
static void cpm_uart_set_termios(struct uart_port *port,
493-
struct ktermios *termios,
494-
struct ktermios *old)
498+
struct ktermios *termios,
499+
struct ktermios *old)
495500
{
496501
int baud;
497502
unsigned long flags;
@@ -628,12 +633,14 @@ static void cpm_uart_set_termios(struct uart_port *port,
628633
* present.
629634
*/
630635
prev_mode = in_be16(&smcp->smc_smcmr) & (SMCMR_REN | SMCMR_TEN);
631-
/* Output in *one* operation, so we don't interrupt RX/TX if they
632-
* were already enabled. */
636+
/* Output in *one* operation, so we don't interrupt RX/TX if
637+
* they were already enabled.
638+
*/
633639
out_be16(&smcp->smc_smcmr, smcr_mk_clen(bits) | cval |
634640
SMCMR_SM_UART | prev_mode);
635641
} else {
636-
out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);
642+
out_be16(&pinfo->sccup->scc_genscc.scc_mrblr,
643+
pinfo->rx_fifosize);
637644
out_be16(&pinfo->sccup->scc_maxidl, maxidl);
638645
out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
639646
}
@@ -777,7 +784,8 @@ static void cpm_uart_initbd(struct uart_cpm_port *pinfo)
777784
* buffers in the buffer descriptors, and the
778785
* virtual address for us to work with.
779786
*/
780-
mem_addr = pinfo->mem_addr + L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
787+
mem_addr = pinfo->mem_addr +
788+
L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize);
781789
bdp = pinfo->tx_cur = pinfo->tx_bd_base;
782790
for (i = 0; i < (pinfo->tx_nrfifos - 1); i++, bdp++) {
783791
out_be32(&bdp->cbd_bufaddr, cpu2cpm_addr(mem_addr, pinfo));
@@ -801,9 +809,9 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
801809

802810
/* Store address */
803811
out_be16(&pinfo->sccup->scc_genscc.scc_rbase,
804-
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
812+
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
805813
out_be16(&pinfo->sccup->scc_genscc.scc_tbase,
806-
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
814+
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
807815

808816
/* Set up the uart parameters in the
809817
* parameter ram.
@@ -840,7 +848,7 @@ static void cpm_uart_init_scc(struct uart_cpm_port *pinfo)
840848
*/
841849
out_be32(&scp->scc_gsmrh, 0);
842850
out_be32(&scp->scc_gsmrl,
843-
SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
851+
SCC_GSMRL_MODE_UART | SCC_GSMRL_TDCR_16 | SCC_GSMRL_RDCR_16);
844852

845853
/* Enable rx interrupts and clear all pending events. */
846854
out_be16(&scp->scc_sccm, 0);
@@ -863,9 +871,9 @@ static void cpm_uart_init_smc(struct uart_cpm_port *pinfo)
863871

864872
/* Store address */
865873
out_be16(&pinfo->smcup->smc_rbase,
866-
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
874+
(u8 __iomem *)pinfo->rx_bd_base - DPRAM_BASE);
867875
out_be16(&pinfo->smcup->smc_tbase,
868-
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
876+
(u8 __iomem *)pinfo->tx_bd_base - DPRAM_BASE);
869877

870878
/*
871879
* In case SMC is being relocated...
@@ -920,8 +928,10 @@ static int cpm_uart_request_port(struct uart_port *port)
920928
clrbits8(&pinfo->smcp->smc_smcm, SMCM_RX | SMCM_TX);
921929
clrbits16(&pinfo->smcp->smc_smcmr, SMCMR_REN | SMCMR_TEN);
922930
} else {
923-
clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
924-
clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
931+
clrbits16(&pinfo->sccp->scc_sccm,
932+
UART_SCCM_TX | UART_SCCM_RX);
933+
clrbits32(&pinfo->sccp->scc_gsmrl,
934+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
925935
}
926936

927937
ret = cpm_uart_allocbuf(pinfo, 0);
@@ -1051,9 +1061,10 @@ static int poll_chars;
10511061
static int poll_wait_key(char *obuf, struct uart_cpm_port *pinfo)
10521062
{
10531063
u_char c, *cp;
1054-
volatile cbd_t *bdp;
10551064
int i;
10561065

1066+
volatile cbd_t *bdp;
1067+
10571068
/* Get the address of the host memory buffer.
10581069
*/
10591070
bdp = pinfo->rx_cur;
@@ -1141,7 +1152,7 @@ static const struct uart_ops cpm_uart_pops = {
11411152
struct uart_cpm_port cpm_uart_ports[UART_NR];
11421153

11431154
static int cpm_uart_init_port(struct device_node *np,
1144-
struct uart_cpm_port *pinfo)
1155+
struct uart_cpm_port *pinfo)
11451156
{
11461157
const u32 *data;
11471158
void __iomem *mem, *pram;
@@ -1151,15 +1162,16 @@ static int cpm_uart_init_port(struct device_node *np,
11511162

11521163
data = of_get_property(np, "clock", NULL);
11531164
if (data) {
1154-
struct clk *clk = clk_get(NULL, (const char*)data);
1165+
struct clk *clk = clk_get(NULL, (const char *)data);
1166+
11551167
if (!IS_ERR(clk))
11561168
pinfo->clk = clk;
11571169
}
11581170
if (!pinfo->clk) {
11591171
data = of_get_property(np, "fsl,cpm-brg", &len);
11601172
if (!data || len != 4) {
11611173
dev_err(port->dev, "CPM UART %pOFn has no/invalid "
1162-
"fsl,cpm-brg property.\n", np);
1174+
"fsl,cpm-brg property.\n", np);
11631175
return -EINVAL;
11641176
}
11651177
pinfo->brg = *data;
@@ -1168,7 +1180,7 @@ static int cpm_uart_init_port(struct device_node *np,
11681180
data = of_get_property(np, "fsl,cpm-command", &len);
11691181
if (!data || len != 4) {
11701182
dev_err(port->dev, "CPM UART %pOFn has no/invalid "
1171-
"fsl,cpm-command property.\n", np);
1183+
"fsl,cpm-command property.\n", np);
11721184
return -EINVAL;
11731185
}
11741186
pinfo->command = *data;
@@ -1182,7 +1194,7 @@ static int cpm_uart_init_port(struct device_node *np,
11821194
pinfo->sccp = mem;
11831195
pinfo->sccup = pram = cpm_uart_map_pram(pinfo, np);
11841196
} else if (of_device_is_compatible(np, "fsl,cpm1-smc-uart") ||
1185-
of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
1197+
of_device_is_compatible(np, "fsl,cpm2-smc-uart")) {
11861198
pinfo->flags |= FLAG_SMC;
11871199
pinfo->smcp = mem;
11881200
pinfo->smcup = pram = cpm_uart_map_pram(pinfo, np);
@@ -1269,19 +1281,17 @@ static void cpm_uart_console_write(struct console *co, const char *s,
12691281
unsigned long flags;
12701282
int nolock = oops_in_progress;
12711283

1272-
if (unlikely(nolock)) {
1284+
if (unlikely(nolock))
12731285
local_irq_save(flags);
1274-
} else {
1286+
else
12751287
spin_lock_irqsave(&pinfo->port.lock, flags);
1276-
}
12771288

12781289
cpm_uart_early_write(pinfo, s, count, true);
12791290

1280-
if (unlikely(nolock)) {
1291+
if (unlikely(nolock))
12811292
local_irq_restore(flags);
1282-
} else {
1293+
else
12831294
spin_unlock_irqrestore(&pinfo->port.lock, flags);
1284-
}
12851295
}
12861296

12871297

@@ -1344,7 +1354,8 @@ static int __init cpm_uart_console_setup(struct console *co, char *options)
13441354
out_be16(&pinfo->sccup->scc_brkcr, 0);
13451355
cpm_line_cr_cmd(pinfo, CPM_CR_GRA_STOP_TX);
13461356
clrbits16(&pinfo->sccp->scc_sccm, UART_SCCM_TX | UART_SCCM_RX);
1347-
clrbits32(&pinfo->sccp->scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT);
1357+
clrbits32(&pinfo->sccp->scc_gsmrl,
1358+
SCC_GSMRL_ENR | SCC_GSMRL_ENT);
13481359
}
13491360

13501361
ret = cpm_uart_allocbuf(pinfo, 1);
@@ -1384,7 +1395,7 @@ static int __init cpm_uart_console_init(void)
13841395

13851396
console_initcall(cpm_uart_console_init);
13861397

1387-
#define CPM_UART_CONSOLE &cpm_scc_uart_console
1398+
#define CPM_UART_CONSOLE (&cpm_scc_uart_console)
13881399
#else
13891400
#define CPM_UART_CONSOLE NULL
13901401
#endif
@@ -1427,6 +1438,7 @@ static int cpm_uart_probe(struct platform_device *ofdev)
14271438
static int cpm_uart_remove(struct platform_device *ofdev)
14281439
{
14291440
struct uart_cpm_port *pinfo = platform_get_drvdata(ofdev);
1441+
14301442
return uart_remove_one_port(&cpm_reg, &pinfo->port);
14311443
}
14321444

@@ -1454,11 +1466,12 @@ static struct platform_driver cpm_uart_driver = {
14541466
},
14551467
.probe = cpm_uart_probe,
14561468
.remove = cpm_uart_remove,
1457-
};
1469+
};
14581470

14591471
static int __init cpm_uart_init(void)
14601472
{
14611473
int ret = uart_register_driver(&cpm_reg);
1474+
14621475
if (ret)
14631476
return ret;
14641477

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)