summaryrefslogtreecommitdiff
path: root/tools/spi
AgeCommit message (Collapse)Author
2016-09-30Merge remote-tracking branches 'spi/topic/ti-qspi', 'spi/topic/tools', ↵Mark Brown
'spi/topic/txx9' and 'spi/topic/xlp' into spi-next
2016-09-30Merge remote-tracking branches 'spi/topic/rspi', 'spi/topic/sc18is602', ↵Mark Brown
'spi/topic/sh-msiof', 'spi/topic/spidev-test' and 'spi/topic/st-ssc4' into spi-next
2016-09-14spi: spidev_test: Fix buffer overflow in unescape()Geert Uytterhoeven
Sometimes spidev_test crashes with: *** Error in `spidev_test': munmap_chunk(): invalid pointer: 0x00022020 *** Aborted or just Segmentation fault This is due to transfer_escaped_string() miscalculating the required size of the buffer by one byte, causing a buffer overflow in unescape(). Drop the bogus "+ 1" in the strlen() parameter to fix this. Note that unescape() never copies the zero-terminator of the source string, so it writes at most as many bytes as the length of the source string. Fixes: 30061915be6e3a2c (spi: spidev_test: Added input buffer from the terminal) Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: <stable@vger.kernel.org> # v4.5+
2016-09-12spi: tools: enable CROSS_COMPILE in MakefileJorge Ramirez-Ortiz
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-15spi: spidev_test: fix build with musl libcBaruch Siach
spidev.h uses _IOC_SIZEBITS directly. musl libc does not provide this macro unless linux/ioctl.h is included explicitly. Fixes build failures like: In file included from .../host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/sys/ioctl.h:7:0, from .../build/spidev_test-v3.15/spidev_test.c:20: .../build/spidev_test-v3.15/spidev_test.c: In function ‘transfer’: .../build/spidev_test-v3.15/spidev_test.c:75:18: error: ‘_IOC_SIZEBITS’ undeclared (first use in this function) ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); ^ Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-08spi: spidev_test: Fix typo in error messageFabio Estevam
Fix the spelling of 'output' in the error message. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-30spi: tools: move spidev_test metadataJoshua Clayton
Now that spidev_test and spidev_fdx have been moved, remove them from the Documentation index and move their .gitignore file. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: spidev_test: fix whitespaceJoshua Clayton
Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: spidev_test: check errorJoshua Clayton
Check the result of sscanf to verify a result was found. report and error and abort if pattern was not found. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: spidev_test: output to a fileJoshua Clayton
For testing of larger data transfers, output unmodified data directly to a file. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: spidev_test: accept input from a fileJoshua Clayton
Add input file support to facilitate testing larger data. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: spidev_test: transfer_escaped_string functionJoshua Clayton
Move the input_tx code into its own small function. This cleans up some variables from main() that are used only here. While we are at it, check malloc calls instead of assuming they succeed. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23spi: Move spi code from Documentation to toolsJoshua Clayton
Jon Corbet requested this code moved with the last changeset, https://lkml.org/lkml/2015/3/1/144, but the patch was not applied because it missed the Makefile. Moved spidev_test, spidev_fdx and their Makefile infrastructure. Signed-off-by: Joshua Clayton <stillcompiling@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>