From: David Brownell Date: Sun, 2 Apr 2006 18:37:40 +0000 (-0800) Subject: [PATCH] SPI: spi bounce buffer has a minimum length X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9948b6194b46e489aa3b4d111d6dfd786c39c4b;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [PATCH] SPI: spi bounce buffer has a minimum length 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: Greg Kroah-Hartman --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 94f5e8ed83a7..1168ef015887 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -522,7 +522,8 @@ int spi_sync(struct spi_device *spi, struct spi_message *message) } 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;