[U-Boot] [PATCH 3/9 v2] i.MX31: support GPIO as a chip-select in the mxc_spi driver

Guennadi Liakhovetski lg at denx.de
Thu Feb 5 17:44:17 CET 2009


On Thu, 5 Feb 2009, Anatolij Gustschin wrote:

> Guennadi Liakhovetski wrote:
> 
> > diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
> > index b7bd84b..1341543 100644
> > --- a/drivers/spi/mxc_spi.c
> > +++ b/drivers/spi/mxc_spi.c
> <snip>
> > @@ -105,6 +112,10 @@ static u32 spi_xchg_single(struct spi_slave *slave, u32 data, int bitlen)
> >  	while (reg_read(mxcs->base + MXC_CSPICTRL) & MXC_CSPICTRL_XCH)
> >  		;
> >  
> > +	if (mxcs->gpio > 0 && (flags & SPI_XFER_END))
> > +		mx31_gpio_set(mxcs->gpio,
> > +			      !(mxcs->ctrl_reg & MXC_CSPICTRL_SSPOL));
> 
> this is a multi-line if statement, I think the preferred coding style
> is as follows:
> 	if (...) {
> 		/*
> 		 * multi-line if statement
> 		 */
> 		...
> 	}
> please fix, Thanks!

Sorry, cannot find this in CodingStyle. Can you point me out? What I do 
find there is this example in Chapter 2:

	if (condition)
		printk(KERN_WARNING "Warning this is a long printk with "
						"3 parameters a: %u b: %u "
						"c: %u \n", a, b, c);
	else
		next_statement;

which implicitly (it is given as an example of breaking lines, not 
parenthesising) states the contrary to your proposition.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de


More information about the U-Boot mailing list