Skip to content

Commit

Permalink
[PATCH] SPI: spi bounce buffer has a minimum length
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed May 16, 2006
1 parent 747d844 commit a9948b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a9948b6

Please sign in to comment.