<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/tools/spi/spidev_test.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/tools/spi/spidev_test.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/tools/spi/spidev_test.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-02-13T13:17:39Z</updated>
<entry>
<title>spi: spidev_test: Use perror() only if errno is not 0</title>
<updated>2020-02-13T13:17:39Z</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2020-02-13T04:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=470a072e12200576788dc622d58894609feae2d7'/>
<id>urn:sha1:470a072e12200576788dc622d58894609feae2d7</id>
<content type='text'>
It is better to use perror() only if errno is not 0, it should use printf()
when errno is 0, otherwise there exists redudant ": Success".

E.g. without this patch:

$ ./spidev_test -p 1234 --input test.bin
only one of -p and --input may be selected: Success
Aborted (core dumped)

With this patch:

$ ./spidev_test -p 1234 --input test.bin
only one of -p and --input may be selected
Aborted (core dumped)

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://lore.kernel.org/r/1581567368-8055-3-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev_test: Check input_tx and input_file first after parse options</title>
<updated>2020-02-13T13:17:19Z</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2020-02-13T04:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=1f3c36328a487059beebd1f7be042e3b7abf7d34'/>
<id>urn:sha1:1f3c36328a487059beebd1f7be042e3b7abf7d34</id>
<content type='text'>
It is better to check input_tx and input_file first after parse options.
Otherwise, it will do some useless operations when both -p and --input
are selected.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://lore.kernel.org/r/1581567368-8055-2-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev_test: Remove break after exit statement</title>
<updated>2020-02-13T13:16:59Z</updated>
<author>
<name>Tiezhu Yang</name>
<email>yangtiezhu@loongson.cn</email>
</author>
<published>2020-02-13T04:16:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=020bd6c48ebd864d42b5b551a87a323e443918a6'/>
<id>urn:sha1:020bd6c48ebd864d42b5b551a87a323e443918a6</id>
<content type='text'>
When call print_usage() in parse_opts(), it will exit directly.
Since break is not useful after exit statement, remove it.

Signed-off-by: Tiezhu Yang &lt;yangtiezhu@loongson.cn&gt;
Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://lore.kernel.org/r/1581567368-8055-1-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 178</title>
<updated>2019-05-30T18:29:19Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-28T16:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=84a14ae8c44fb4828a05f363a09c3261472de00e'/>
<id>urn:sha1:84a14ae8c44fb4828a05f363a09c3261472de00e</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license as published by
  the free software foundation either version 2 of the license

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 24 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Steve Winslow &lt;swinslow@gmail.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Reviewed-by: Richard Fontana &lt;rfontana@redhat.com&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190528170026.162703968@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev_test: Improve decoded text part of hex dump</title>
<updated>2018-09-04T16:00:37Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2018-09-03T17:33:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=35386dfd13b746daf36a393bdf066dbe9b9b7aed'/>
<id>urn:sha1:35386dfd13b746daf36a393bdf066dbe9b9b7aed</id>
<content type='text'>
- Print spaces as spaces,
  - Do not print characters &gt; 126, as they will be shown as garbage
    in the modern UTF-8 era,
  - Use a normal period instead of its hexadecimal ASCII value,
  - Delimit the text part with pipe symbols on both sides (was left side
    only), without any spaces, to make it clear where the decoded text
    starts and ends,
  - Drop a useless comment.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev_test: add option to continuously transfer data</title>
<updated>2017-03-21T18:44:40Z</updated>
<author>
<name>Frode Isaksen</name>
<email>fisaksen@baylibre.com</email>
</author>
<published>2017-03-21T15:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=9006a7b3220e7293ef8bc1ac9bba6c54411051c1'/>
<id>urn:sha1:9006a7b3220e7293ef8bc1ac9bba6c54411051c1</id>
<content type='text'>
Add option to send+recv &lt;size&gt; bytes with &lt;iter&gt; iterations
and show the transfer rate every 5 seconds.
Example:
rate: tx 4235.2kbps, rx 4235.2kbps
total: tx 4882.8KB, rx 4882.8KB

Signed-off-by: Frode Isaksen &lt;fisaksen@baylibre.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: spidev_test: Fix input file check when transferring file</title>
<updated>2016-11-04T15:56:09Z</updated>
<author>
<name>Michal Vokáč</name>
<email>vokac.m@gmail.com</email>
</author>
<published>2016-11-04T10:30:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=e634b76caf830e802731e3491b24726883d1be98'/>
<id>urn:sha1:e634b76caf830e802731e3491b24726883d1be98</id>
<content type='text'>
Check the input file fd instead of spidev fd.
The spidev fd is supposed to be OK otherwise the transfer_file() function
would not be called at all.

Signed-off-by: Michal Vokáč &lt;vokac.m@gmail.com&gt;
Reviewed-by: Joshua Clayton &lt;stillcompiling@gmail.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge remote-tracking branches 'spi/topic/rspi', 'spi/topic/sc18is602', 'spi/topic/sh-msiof', 'spi/topic/spidev-test' and 'spi/topic/st-ssc4' into spi-next</title>
<updated>2016-09-30T16:14:18Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2016-09-30T16:14:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=3424ff29a0c245a7bebe51b6af21cff1e3dd315e'/>
<id>urn:sha1:3424ff29a0c245a7bebe51b6af21cff1e3dd315e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>spi: spidev_test: Fix buffer overflow in unescape()</title>
<updated>2016-09-14T15:22:43Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2016-09-09T07:02:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=0278b34bf15f8d8a609595b15909cd8622dd64ca'/>
<id>urn:sha1:0278b34bf15f8d8a609595b15909cd8622dd64ca</id>
<content type='text'>
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 &lt;geert+renesas@glider.be&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v4.5+
</content>
</entry>
<entry>
<title>spi: spidev_test: fix build with musl libc</title>
<updated>2016-08-15T13:23:55Z</updated>
<author>
<name>Baruch Siach</name>
<email>baruch@tkos.co.il</email>
</author>
<published>2016-08-12T13:04:33Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8736f8022e532a3c1d8873aac78e1113c6ffc3b9'/>
<id>urn:sha1:8736f8022e532a3c1d8873aac78e1113c6ffc3b9</id>
<content type='text'>
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), &amp;tr);
                  ^

Signed-off-by: Baruch Siach &lt;baruch@tkos.co.il&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
