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, 27 Apr 2015 20:55:50 +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 Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote:

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

Two problems here.  One is that the above logic statement is just not
readable (the repitition of hecks, the ternery operator, the
indentation...) and the other is that the core chipselect support
already handles GPIO chipselects so you should really be converting the
driver to use that.  At the very least the code needs to be legible
though.

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