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:	Mon, 17 Jun 2013 10:42:01 -0700
From:	Joe Perches <joe@...ches.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Lorenz Haspel <lorenz@...gers.com>, devel@...uxdriverproject.org,
	gregkh@...uxfoundation.org, puff65537@...sheeslibrary.com,
	viro@...iv.linux.org.uk, michael.banken@...he.stud.uni-erlangen.de,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	linux-kernel@...informatik.uni-erlangen.de
Subject: Re: [PATCH 1/4] silicom: checkpatch: assignments in if conditions

On Mon, 2013-06-17 at 20:22 +0300, Dan Carpenter wrote:
> This will need to be redone because there were some buggy extra
> lines added toward the end of the patch.

[]

> > @@ -4867,10 +4884,12 @@ int set_tx_fn(bpctl_dev_t *pbpctl_dev, int tx_state)
> >  	    (pbpctl_dev->bp_caps & SW_CTL_CAP)) {
> >  		if ((pbpctl_dev->bp_tpl_flag))
> >  			return BP_NOT_CAP;
> > -	} else if ((pbpctl_dev_b = get_master_port_fn(pbpctl_dev))) {
> > -		if ((pbpctl_dev_b->bp_caps & TPL_CAP) &&
> > -		    (pbpctl_dev_b->bp_tpl_flag))
> > -			return BP_NOT_CAP;
> > +	} else {
> > +		pbpctl_dev_b = get_status_port_fn(pbpctl_dev);
> > +		if (pbpctl_dev_b)
> > +			if ((pbpctl_dev_b->bp_caps & TPL_CAP) &&
> > +			    (pbpctl_dev_b->bp_tpl_flag))
> > +				return BP_NOT_CAP;
> 
> Please put curly brace {} around multi-line indents.  Even though
> they are not needed for semantic reasons they make the code more
> readable.

Better still would be to combine the multi-statement ifs
into a single test and avoid the braces altogether.

		if (pbpctl_dev_b &&
		    pbpctl_dev_b->bp_caps & TPL_CAP &&
		    pbpctl_dev_b->bp_tpl_flag)


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