linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Simon Glass <sjg@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Jiri Kosina <trivial@kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: trivial checkpatch fixes in drivers/tty/serial/8250.c
Date: Thu, 19 Jan 2012 11:49:54 -0800	[thread overview]
Message-ID: <1327002594.6404.27.camel@joe2Laptop> (raw)
In-Reply-To: <1327001868-29941-1-git-send-email-sjg@chromium.org>

On Thu, 2012-01-19 at 11:37 -0800, Simon Glass wrote:
> This makes the file checkpatch clean, fixing these warnings:

Some comments...

> This warning remains, since I am not sure how to fix it:
> error: drivers/tty/serial/8250.c,2929: Macros with complex values should
> 	be enclosed in parenthesis

you can ignore this warning.

> diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
[]
> @@ -669,7 +669,8 @@ static void disable_rsa(struct uart_8250_port *up)
>  		result = !(mode & UART_RSA_MSR_FIFO);
>  
>  		if (!result) {
> -
> 			serial_outp(up, UART_RSA_MSR, mode & ~UART_RSA_MSR_FIFO);
> +			serial_outp(up, UART_RSA_MSR, mode
> +					& ~UART_RSA_MSR_FIFO);

If it's really necessary to use 80 columns,
I'd prefer this sort of change be:
			serial_outp(up, UART_RSA_MSR,
				    mode & ~UART_RSA_MSR_FIFO);

[]
> @@ -2006,7 +2010,8 @@ static int serial8250_startup(struct uart_port *port)
>  	 */
>  	if (!(up->port.flags & UPF_BUGGY_UART) &&
>  	    (serial_inp(up, UART_LSR) == 0xff)) {
> -		printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n",
> +		printk_ratelimited(KERN_INFO

		pr_info_ratelimited()


> @@ -2019,10 +2024,13 @@ static int serial8250_startup(struct uart_port *port)
>  
>  		serial_outp(up, UART_LCR, UART_LCR_CONF_MODE_B);
>  
> -		fctr = serial_inp(up, UART_FCTR) & ~(UART_FCTR_RX|UART_FCTR_TX);
> -		serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD | UART_FCTR_RX);
> +		fctr = serial_inp(up, UART_FCTR) &
> +				  ~(UART_FCTR_RX | UART_FCTR_TX);
> +		serial_outp(up, UART_FCTR, fctr | UART_FCTR_TRGD |
> +			    UART_FCTR_RX);

I think it's better to have all the or's
on the same line where possible.

		serial_outp(up, UART_FCTR,
			    fctr | UART_FCTR_TRGD | UART_FCTR_RX);


> @@ -3130,7 +3139,8 @@ static struct platform_device *serial8250_isa_devs;
>   */
>  static DEFINE_MUTEX(serial_mutex);
>  
> -static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *port)
> +static struct uart_8250_port *serial8250_find_match_or_unused(
> +						struct uart_port *port)

It might be better to use

static struct uart_8250_port *
serial8250_find_match_or_unused(struct uart_port *port)
{
> @ -3345,10 +3352,12 @@ MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
>  	" (unsafe)");
>  
>  module_param(nr_uarts, uint, 0644);
> -MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");
> +MODULE_PARM_DESC(nr_uarts, "Maximum number of UARTs supported. (1-" \
> +		 __MODULE_STRING(CONFIG_SERIAL_8250_NR_UARTS) ")");

Broken.

Don't use line continuations with whitespace on the next line.
Better not use line continations at all except in #defines

 
>  module_param(skip_txen_test, uint, 0644);
> -MODULE_PARM_DESC(skip_txen_test, "Skip checking for the TXEN bug at init time");
> +MODULE_PARM_DESC(skip_txen_test, \
> +		"Skip checking for the TXEN bug at init time");

Useless line continuation.



  reply	other threads:[~2012-01-19 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 19:37 [PATCH] serial: trivial checkpatch fixes in drivers/tty/serial/8250.c Simon Glass
2012-01-19 19:49 ` Joe Perches [this message]
2012-01-20  0:23   ` Simon Glass
2012-01-20  0:24 ` [PATCH v2] " Simon Glass
2012-01-20 15:43   ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1327002594.6404.27.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sjg@chromium.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).