]> git.itanic.dy.fi Git - linux-stable/commit
spi: Reorder fields in 'struct spi_transfer'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 14 Feb 2023 10:34:50 +0000 (11:34 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 14 Feb 2023 13:27:58 +0000 (13:27 +0000)
commit9d77522b45246c3dc5950b9641aea49ce3c973d7
tree4b27e9f633ec4a540531f3618f126bb18f3537d4
parent937ca916bf4de427242fb78105a0089af0dd43b3
spi: Reorder fields in 'struct spi_transfer'

Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size from 144 to 128 bytes.

Turn 'timestamped' into a bitfield so that it can be easily merged with
some other bifields and move 'error'.

This should have no real impact on memory allocation because 'struct
spi_transfer' is mostly used on stack, but it can save a few cycles
when the structure is initialized or copied.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/93a051da85a895bc6003aedfb00a13e1c2fc6338.1676370870.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h