outreachy.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: "Pedro Guimarães" <moisespedro15@gmail.com>
Cc: gregkh@linuxfoundation.org, outreachy@lists.linux.dev
Subject: Re: [PATCH v2] staging: axis-fifo: Fixes parenthesis alignment
Date: Sat, 9 Mar 2024 17:45:46 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2403091743490.3311@hadrien> (raw)
In-Reply-To: <ZeyRCcO8JFHI90lK@toolbox>

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



On Sat, 9 Mar 2024, Pedro Guimarães wrote:

> This patch fixes the checks reported by checkpatch
> for alignment should match open parenthesis
>
> Signed-off-by: Pedro Guimarães <moisespedro15@gmail.com>
> ---
>  drivers/staging/axis-fifo/axis-fifo.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
> index c51818c56dd2..600d81043946 100644
> --- a/drivers/staging/axis-fifo/axis-fifo.c
> +++ b/drivers/staging/axis-fifo/axis-fifo.c
> @@ -376,8 +376,8 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
>  		 */
>  		mutex_lock(&fifo->read_lock);
>  		ret = wait_event_interruptible_timeout(fifo->read_queue,
> -			ioread32(fifo->base_addr + XLLF_RDFO_OFFSET),
> -			read_timeout);
> +						       ioread32(fifo->base_addr + XLLF_RDFO_OFFSET),
> +						       read_timeout);
>
>  		if (ret <= 0) {
>  			if (ret == 0) {
> @@ -517,9 +517,9 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
>  		 */
>  		mutex_lock(&fifo->write_lock);
>  		ret = wait_event_interruptible_timeout(fifo->write_queue,
> -			ioread32(fifo->base_addr + XLLF_TDFV_OFFSET)
> -				 >= words_to_write,
> -			write_timeout);
> +						       ioread32(fifo->base_addr +
> +							       XLLF_TDFV_OFFSET) >= words_to_write,
> +						       write_timeout);

Actually, I suggested to ignore the checkpatch warning, and only put the
>= thing on the line before.

In general, splitting the arguments of binary operators such as + and >=
makes the code hard to read.

Also, I received this message twice (or at least two messages that looked
very similar).  Try not to do this, because then the recipient has to
spend time checking whether they are the same or what are the differences
between them.

thanks,
julia

  reply	other threads:[~2024-03-09 16:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 16:40 [PATCH v2] staging: axis-fifo: Fixes parenthesis alignment Pedro Guimarães
2024-03-09 16:45 ` Julia Lawall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-09 16:39 Pedro Guimarães

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=alpine.DEB.2.22.394.2403091743490.3311@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=moisespedro15@gmail.com \
    --cc=outreachy@lists.linux.dev \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).