]> git.baikalelectronics.ru Git - kernel.git/commit
spi: Use bitfields for multiple data lines
authorMark Brown <broonie@linaro.org>
Fri, 10 Jan 2014 17:09:53 +0000 (17:09 +0000)
committerMark Brown <broonie@linaro.org>
Mon, 13 Jan 2014 10:13:28 +0000 (10:13 +0000)
commit6fac1be27ea0b1b266ef099504707c2dc29058be
tree0e6cce807a503acdeac23e1267a4c2fb1c9585b6
parent4b85ccf9b9316175f4b17107afd00d199b4a0cde
spi: Use bitfields for multiple data lines

Trent Piepho observed that since the current realistic maximum number of
data lines is four we can pack the spi_transfer struct more efficiently
if we use a bitfield for the number of bits, allowing the fields to fit
in a single byte along with cs_change.

If space becomes an issue further optimiation is possible by only using
the constants and packing the values chosen for them.

Reported-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
include/linux/spi/spi.h