public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Théo Lebrun" <theo.lebrun@bootlin.com>
Cc: "Russell King" <linux@armlinux.org.uk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-serial <linux-serial@vger.kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
	"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>
Subject: Re: [PATCH v2 3/5] tty: serial: amba-pl011: cleanup driver
Date: Thu, 16 Nov 2023 14:16:47 +0200 (EET)	[thread overview]
Message-ID: <971f533-261a-3095-38a-586c74da543e@linux.intel.com> (raw)
In-Reply-To: <20231116-mbly-uart-v2-3-863f665ce520@bootlin.com>

[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]

On Thu, 16 Nov 2023, Théo Lebrun wrote:

> Follow recommandations from:
> 
>     $ ./scripts/checkpatch.pl --strict --file \
>             drivers/tty/serial/amba-pl011.c
> 
> It does NOT fix alerts relative to TIOCMBIT which will be dealt with in
> another patch. Fixes following alerts:
> 
>     CHECK: Alignment should match open parenthesis
>     CHECK: Blank lines aren't necessary after an open brace '{'
>     CHECK: Comparison to NULL could be written [...]
>     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: Prefer using the BIT macro
>     CHECK: Unbalanced braces around else statement
>     CHECK: Unnecessary parentheses around [...]
>     CHECK: braces {} should be used on all arms of this statement
>     CHECK: spaces preferred around that '/' (ctx:VxV)
>     CHECK: spaces preferred around that '|' (ctx:VxV)
>     ERROR: do not initialise statics to false
>     WARNING: Comparisons should place the constant on the right side of the test
>     WARNING: Possible unnecessary 'out of memory' message
>     WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
>     WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
>     WARNING: quoted string split across lines
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
> ---

> @@ -2916,9 +2911,12 @@ static int sbsa_uart_probe(struct platform_device *pdev)
>  	if (qdf2400_e44_present) {
>  		dev_info(&pdev->dev, "working around QDF2400 SoC erratum 44\n");
>  		uap->vendor = &vendor_qdt_qdf2400_e44;
> -	} else
> -#endif
> +	} else {
>  		uap->vendor = &vendor_sbsa;
> +	}
> +#else
> +	uap->vendor = &vendor_sbsa;
> +#endif

IMO, this would look a lot nicer if you make a function out of it (but 
perhaps it can be changed in a follow-up patch):

#ifdef CONFIG_ACPI_SPCR_TABLE
static void qpdf2400_erratum44_workaround(struct platform_device *pdev,
					  struct uart_amba_port *uap)
{
	if (!qdf2400_e44_present)
		return;

	dev_info(&pdev->dev, "working around QDF2400 SoC erratum 44\n");
	uap->vendor = &vendor_qdt_qdf2400_e44;
}
#else
static void qpdf2400_erratum44_workaround(struct platform_device *pdev,
					  struct uart_amba_port *uap) { }	
#endif


static int sbsa_uart_probe(struct platform_device *pdev)
{
	...
	uap->vendor = &vendor_sbsa;
	qpdf2400_erratum44_workaround(pdev, uap);
	...
}


Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>


-- 
 i.

  reply	other threads:[~2023-11-16 12:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 10:31 [PATCH v2 0/5] Cleanup AMBA PL011 driver Théo Lebrun
2023-11-16 10:31 ` [PATCH v2 1/5] tty: serial: amba: cleanup whitespace Théo Lebrun
2023-11-16 12:17   ` Ilpo Järvinen
2023-11-16 10:31 ` [PATCH v2 2/5] tty: serial: amba: Use BIT() macro for constant declarations Théo Lebrun
2023-11-16 11:55   ` Ilpo Järvinen
2023-11-16 10:31 ` [PATCH v2 3/5] tty: serial: amba-pl011: cleanup driver Théo Lebrun
2023-11-16 12:16   ` Ilpo Järvinen [this message]
2023-11-16 10:31 ` [PATCH v2 4/5] tty: serial: amba-pl011: replace TIOCMBIT macros by static functions Théo Lebrun
2023-11-16 10:31 ` [PATCH v2 5/5] tty: serial: amba-pl011: unindent pl011_console_get_options function body Théo Lebrun
2023-11-16 11:59   ` Ilpo Järvinen

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=971f533-261a-3095-38a-586c74da543e@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.clement@bootlin.com \
    --cc=jirislaby@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=tawfik.bayouk@mobileye.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.kondratiev@mobileye.com \
    /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