outreachy.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: axis-fifo: Fixes parenthesis alignment
@ 2024-03-08  3:34 Pedro Guimarães
  2024-03-08 10:15 ` Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro Guimarães @ 2024-03-08  3:34 UTC (permalink / raw
  To: gregkh, outreachy

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..a70af76be7fb 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);
 
 		if (ret <= 0) {
 			if (ret == 0) {
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: axis-fifo: Fixes parenthesis alignment
  2024-03-08  3:34 [PATCH] staging: axis-fifo: Fixes parenthesis alignment Pedro Guimarães
@ 2024-03-08 10:15 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2024-03-08 10:15 UTC (permalink / raw
  To: Pedro Guimarães; +Cc: gregkh, outreachy

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



On Fri, 8 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..a70af76be7fb 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);

I have the impression that it was more readable beforehand.

On the other hand, the placement of >= words_to_write does not seem ideal,
because it is hard to see what exactly is being compared.  Perhaps exploit
the fact that 100 characters are allowed to move that up to the right of
the call to ioread32.

julia

>
>  		if (ret <= 0) {
>  			if (ret == 0) {
> --
> 2.44.0
>
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-08 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08  3:34 [PATCH] staging: axis-fifo: Fixes parenthesis alignment Pedro Guimarães
2024-03-08 10:15 ` Julia Lawall

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).