lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Oct 2018 23:18:17 -0700
From:   Joe Perches <joe@...ches.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        Aleksa Zdravkovic <alex.zdravkovic98@...il.com>
Cc:     gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: axis-fifo: Fix line over 80 characters error

On Thu, 2018-10-25 at 09:05 +0300, Dan Carpenter wrote:
> On Wed, Oct 24, 2018 at 05:05:53PM +0200, Aleksa Zdravkovic wrote:
> > This patch fixes the checkpatch.pl warning:
[]
> > diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
[]
> > @@ -482,10 +482,10 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
> >  		spin_lock_irq(&fifo->write_queue_lock);
> >  		ret = wait_event_interruptible_lock_irq_timeout
> >  			(fifo->write_queue,
> > -			 ioread32(fifo->base_addr + XLLF_TDFV_OFFSET)
> > +			ioread32(fifo->base_addr + XLLF_TDFV_OFFSET)
> >  				>= words_to_write,
> > -			 fifo->write_queue_lock,
> > -			 (write_timeout >= 0) ? msecs_to_jiffies(write_timeout) :
> > +			fifo->write_queue_lock,
> > +			(write_timeout >= 0) ? msecs_to_jiffies(write_timeout) :
> >  				MAX_SCHEDULE_TIMEOUT);
> 
> The original was fine.  Just leave it.
> 
> Checkpatch.pl is only useful if it improves the readability for humans.

True, but I think the original is just OK.

Any suggestion on how to make the thing better?

wait_event_interruptible_lock_irq_timeout is a fairly long
identifier with multiple long arguments.

It's as if it should be written here as

 		ret = wait_event_interruptible_lock_irq_timeout(fifo->write_queue,
								ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >= words_to_write,
								fifo->write_queue_lock,
								write_timeout >= 0 ? msecs_to_jiffies(write_timeout) : MAX_SCHEDULE_TIMEOUT);

where the longest is way over 80 chars, (140?) but I simply don't care
because it's just that much more readable for me.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ