[PATCH] spi: bitbang: only toggle bitchanges

Mark Brown broonie at kernel.org
Tue Mar 31 07:13:21 PDT 2015


On Tue, Mar 31, 2015 at 03:54:49PM +0200, Michael Grzeschik wrote:

>  		if ((flags & SPI_MASTER_NO_TX) == 0)
> -			setmosi(spi, word & (1 << 31));
> +			if ((word & (1 << 31)) != oldbit) {
> +				setmosi(spi, word & (1 << 31));
> +				oldbit = word & (1 << 31);
> +			}
>  		spidelay(nsecs);	/* T(setup) */

This change is fine but for legibility can you please add braces around
the outer if as well?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150331/d1710f9b/attachment.sig>


More information about the linux-arm-kernel mailing list