Commit d93ebe0f authored by Théo Lebrun's avatar Théo Lebrun Committed by Greg Kroah-Hartman
Browse files

tty: serial: amba-pl011: fix whitespace formatting



Follow recommandations from:

    $ ./scripts/checkpatch.pl --strict --file \
        drivers/tty/serial/amba-pl011.c

We fix 5 warnings and 48 checks, all related to whitespace.
Culprits are:

CHECK: Alignment should match open parenthesis
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Lines should not end with a '('
CHECK: Please don't use multiple blank lines
CHECK: Please use a blank line after function/struct/union/enum
       declarations
CHECK: spaces preferred around that '/' (ctx:VxV)
CHECK: spaces preferred around that '|' (ctx:VxV)
WARNING: Missing a blank line after declarations
WARNING: please, no spaces at the start of a line

Signed-off-by: default avatarThéo Lebrun <theo.lebrun@bootlin.com>
Link: https://lore.kernel.org/r/20231207-mbly-uart-v6-2-e384afa5e78c@bootlin.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f78c560
Loading
Loading
Loading
Loading
+45 −52
Original line number Diff line number Diff line
@@ -358,7 +358,6 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap)
	return fifotaken;
}


/*
 * All the DMA operation mode stuff goes inside this ifdef.
 * This assumes that you have a generic DMA device interface,
@@ -499,18 +498,16 @@ static void pl011_dma_probe(struct uart_amba_port *uap)
			else
				uap->dmarx.poll_timeout = 3000;
		} else if (!plat && dev->of_node) {
			uap->dmarx.auto_poll_rate = of_property_read_bool(
						dev->of_node, "auto-poll");
			uap->dmarx.auto_poll_rate =
					of_property_read_bool(dev->of_node, "auto-poll");
			if (uap->dmarx.auto_poll_rate) {
				u32 x;

				if (0 == of_property_read_u32(dev->of_node,
						"poll-rate-ms", &x))
				if (0 == of_property_read_u32(dev->of_node, "poll-rate-ms", &x))
					uap->dmarx.poll_rate = x;
				else
					uap->dmarx.poll_rate = 100;
				if (0 == of_property_read_u32(dev->of_node,
						"poll-timeout-ms", &x))
				if (0 == of_property_read_u32(dev->of_node, "poll-timeout-ms", &x))
					uap->dmarx.poll_timeout = x;
				else
					uap->dmarx.poll_timeout = 3000;
@@ -889,14 +886,12 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,

	/* Pick the remain data from the DMA */
	if (pending) {

		/*
		 * First take all chars in the DMA pipe, then look in the FIFO.
		 * Note that tty_insert_flip_buf() tries to take as many chars
		 * as it can.
		 */
		dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken,
				pending);
		dma_count = tty_insert_flip_string(port, dbuf->buf + dmataken, pending);

		uap->port.icount.rx += dma_count;
		if (dma_count < pending)
@@ -1085,7 +1080,6 @@ static void pl011_dma_rx_poll(struct timer_list *t)
	 */
	if (jiffies_to_msecs(jiffies - dmarx->last_jiffies)
			> uap->dmarx.poll_timeout) {

		uart_port_lock_irqsave(&uap->port, &flags);
		pl011_dma_rx_stop(uap);
		uap->im |= UART011_RXIM;
@@ -1169,8 +1163,7 @@ static void pl011_dma_startup(struct uart_amba_port *uap)
		if (uap->dmarx.poll_rate) {
			timer_setup(&uap->dmarx.timer, pl011_dma_rx_poll, 0);
			mod_timer(&uap->dmarx.timer,
				jiffies +
				msecs_to_jiffies(uap->dmarx.poll_rate));
				  jiffies + msecs_to_jiffies(uap->dmarx.poll_rate));
			uap->dmarx.last_residue = PL011_DMA_BUFFER_SIZE;
			uap->dmarx.last_jiffies = jiffies;
		}
@@ -1409,8 +1402,7 @@ __acquires(&uap->port.lock)
				uap->dmarx.last_jiffies = jiffies;
				uap->dmarx.last_residue	= PL011_DMA_BUFFER_SIZE;
				mod_timer(&uap->dmarx.timer,
					jiffies +
					msecs_to_jiffies(uap->dmarx.poll_rate));
					  jiffies + msecs_to_jiffies(uap->dmarx.poll_rate));
			}
#endif
		}
@@ -1557,8 +1549,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id)
		do {
			check_apply_cts_event_workaround(uap);

			pl011_write(status & ~(UART011_TXIS|UART011_RTIS|
					       UART011_RXIS),
			pl011_write(status & ~(UART011_TXIS | UART011_RTIS | UART011_RXIS),
				    uap, REG_ICR);

			if (status & (UART011_RTIS | UART011_RXIS)) {
@@ -1707,8 +1698,7 @@ static int pl011_get_poll_char(struct uart_port *port)
	return pl011_read(uap, REG_DR);
}

static void pl011_put_poll_char(struct uart_port *port,
			 unsigned char ch)
static void pl011_put_poll_char(struct uart_port *port, unsigned char ch)
{
	struct uart_amba_port *uap =
	    container_of(port, struct uart_amba_port, port);
@@ -1909,8 +1899,7 @@ static int sbsa_uart_startup(struct uart_port *port)
	return 0;
}

static void pl011_shutdown_channel(struct uart_amba_port *uap,
					unsigned int lcrh)
static void pl011_shutdown_channel(struct uart_amba_port *uap, unsigned int lcrh)
{
	unsigned long val;

@@ -2218,6 +2207,7 @@ static void pl011_config_port(struct uart_port *port, int flags)
static int pl011_verify_port(struct uart_port *port, struct serial_struct *ser)
{
	int ret = 0;

	if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA)
		ret = -EINVAL;
	if (ser->irq < 0 || ser->irq >= nr_irqs)
@@ -2613,7 +2603,9 @@ static int __init pl011_early_console_setup(struct earlycon_device *device,

	return 0;
}

OF_EARLYCON_DECLARE(pl011, "arm,pl011", pl011_early_console_setup);

OF_EARLYCON_DECLARE(pl011, "arm,sbsa-uart", pl011_early_console_setup);

/*
@@ -2636,6 +2628,7 @@ qdf2400_e44_early_console_setup(struct earlycon_device *device,
	device->con->write = qdf2400_e44_early_write;
	return 0;
}

EARLYCON_DECLARE(qdf2400_e44, qdf2400_e44_early_console_setup);

#else