Nico Huber posted comments on this change.
Patch set 3:
(4 comments)
The max buffer size of the linux kernel's SPI device is a compile-time
parameter.
That's not true, and I can say that from this patch: If we
read it from a module parameter representation in sysfs it's
obviously not compile-time.
if (param_fd != -1)
close(param_fd);
May as well put this in the else clause above.
No, the else path is not hit if open() succeeds but read() fails.
Patch Set #3, Line 134: int param_fd = open("/sys/module/spidev/parameters/bufsiz", O_RDONLY);
Isn't there a way to query this over the device interface?
Patch Set #3, Line 135: if (param_fd == -1 || read(param_fd, &buf, sizeof(buf) - 1) == -1) {
What if read() returns a short byte count? What if it gets inter-
rupted (I have to admit, unlikely on sysfs). Generally, using the
low level file functions is a bad idea if you can use stream func-
tions (e.g. fread()) instead.
To view, visit change 22344. To unsubscribe, visit settings.