lkml.org 
[lkml]   [2006]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/10] SPI: spi bounce buffer has a minimum length
Date
From: David Brownell <david-b@pacbell.net>

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 <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---

drivers/spi/spi.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

a9948b6194b46e489aa3b4d111d6dfd786c39c4b
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 94f5e8e..1168ef0 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -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;

--
1.3.2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-16 23:46    [W:0.028 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site