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] [day] [month] [year] [list]
Date:	Wed, 29 Apr 2015 11:47:37 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Michael Welling <mwelling@...e.org>
Cc:	linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

On Tue, Apr 28, 2015 at 06:06:43PM -0500, Michael Welling wrote:
> On Tue, Apr 28, 2015 at 03:34:25PM +0100, Mark Brown wrote:

> > > 	if (gpio_is_valid(spi->cs_gpio)) {
> > > 		if (cs_active)
> > > 			gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH);
> > > 		else
> > > 			gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
> > > 	}

> > That's good but please have braces around the inner if for clarity.

> I try to follow the CodingStyle documentation and it says differently:
> http://lxr.free-electrons.com/source/Documentation/CodingStyle#L156

That's for free standing if statements, the reason I'm asking for braces
at both levels here is that you've got a nested if - it's similar to
having braces on both branches of an if, being consistent within the
same statement.

> I have also been looking at ways of allowing more GPIO chipselects than
> DMA channels. Currently this driver is limited to one chipselect per
> DMA channel.

> Do you have any ideas on how to accomplish this?

Just use a single channel for the controller rather than allocating them
per device?  It's not like the controller is going to be able to
interact with multiple devics simultaneously.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ