Thread (1 message) 1 message, 1 author, 2015-11-17

[PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file

From: Joshua Clayton <hidden>
Date: 2015-11-17 19:28:34
Also in: linux-spi, lkml

On Tuesday, November 17, 2015 07:26:54 PM Anton Bondarenko wrote:
On 17.11.2015 16:24, Joshua Clayton wrote:
quoted
+	if (sb.st_size > 4096)
+		pabort("input file exceeds spidev's 4k limit");
This is not a true. IIRC PAGE_SIZE is the default buffer size for 
spidev, but can be changed using bufsiz module parameter.
Just 'insmod spidev bufsiz=X', where X is number of bytes.
You are right. I will drop this. As Mark suggests.
The ioctl gives a nice error code if the buffer is too big.

...
quoted
+	tx = malloc(sb.st_size);
It would be good to check new allocations for fail.
I will add a check for this. 

-- 
~Joshua Clayton
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help