From: David Brownell Someone pointed out that "one cacheline's worth of data" isn't as portable as might be desired, so this adds a 32-byte floor. Make sure that spi_write_then_read() can always handle at least 32 bytes of transfer (total, both directions), minimizing one portability issue. Signed-off-by: David Brownell Signed-off-by: Andrew Morton --- drivers/spi/spi.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/spi/spi.c~spi-bounce-buffer-has-a-minimum-length drivers/spi/spi.c --- 25/drivers/spi/spi.c~spi-bounce-buffer-has-a-minimum-length Mon Apr 3 15:54:24 2006 +++ 25-akpm/drivers/spi/spi.c Mon Apr 3 15:54:24 2006 @@ -522,7 +522,8 @@ int spi_sync(struct spi_device *spi, str } EXPORT_SYMBOL_GPL(spi_sync); -#define SPI_BUFSIZ (SMP_CACHE_BYTES) +/* portable code must never pass more than 32 bytes */ +#define SPI_BUFSIZ max(32,SMP_CACHE_BYTES) static u8 *buf; _