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]
Message-ID: <DC148C5AA1CEBA4E87973D432B1C2D8825F28DA8@P3PWEX4MB008.ex4.secureserver.net>
Date:	Wed, 30 Jul 2014 00:34:01 +0000
From:	Hartley Sweeten <HartleyS@...ionengravers.com>
To:	Ian Abbott <abbotti@....co.uk>,
	"driverdev-devel@...uxdriverproject.org" 
	<driverdev-devel@...uxdriverproject.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 13/19] staging: comedi: amplc_pci230: remove unnecessary
 braces

On Tuesday, July 29, 2014 4:58 AM,  Ian Abbott wrote:
> Signed-off-by: Ian Abbott <abbotti@....co.uk>
> ---
>  drivers/staging/comedi/drivers/amplc_pci230.c | 151 ++++++++++----------------
>  1 file changed, 58 insertions(+), 93 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c
> index 4222e28..df58679 100644
> --- a/drivers/staging/comedi/drivers/amplc_pci230.c
> +++ b/drivers/staging/comedi/drivers/amplc_pci230.c
> @@ -672,7 +672,7 @@ static int get_resources(struct comedi_device *dev, unsigned int res_mask,
>  	ok = 1;
>  	claimed = 0;
>  	spin_lock_irqsave(&devpriv->res_spinlock, irqflags);
> -	for (b = 1, i = 0; (i < NUM_RESOURCES) && res_mask; b <<= 1, i++) {
> +	for (b = 1, i = 0; (i < NUM_RESOURCES) && res_mask; b <<= 1, i++)
>  		if (res_mask & b) {
>  			res_mask &= ~b;
>  			if (devpriv->res_owner[i] == OWNER_NONE) {
> @@ -690,7 +690,6 @@ static int get_resources(struct comedi_device *dev, unsigned int res_mask,
>  				break;
>  			}
>  		}
> -	}

Technically the braces you remove in this patch _are_
unnecessary. But, I think the driver is more confusing
with them removed.

In a lot of places there is quite a bit of code between
where the opening and closing braces would be.
Granted, a lot of them are due to the wordy comments
but some are in places like:

	for (...)
		if (...) {
			...
		}

There aren't too bad but the one like this are:

	If (...)
		If (...)
			...
		else
			...
	else
		...

The nested if/else blocks are easy to break.

Just my two cents...
Hartley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ