diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2022-12-21 09:04:09 +0000 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2023-03-29 10:20:05 +0300 |
commit | 9d46d348f649f640b2ba0b0b160b562c8f720fc9 (patch) | |
tree | 42ee8ea41bf520fdc381da21cabe51382e3bfa85 /tests | |
parent | 7c8a67ed462a1089e7c3837cb94579031c6ecc6b (diff) |
tests/tcg: fix unused variable in linux-test
The latest hexagon compiler picks up that we never consume wcount.
Given the name of the #define that rcount checks against is WCOUNT_MAX
I figured the check just got missed.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221221090411.1995037-5-alex.bennee@linaro.org>
(cherry picked from commit 2bc6c79417b89c3306b724577e775f03fe61fb2e)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tcg/multiarch/linux/linux-test.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/tcg/multiarch/linux/linux-test.c b/tests/tcg/multiarch/linux/linux-test.c index 5a2a4f2258..64f57cb287 100644 --- a/tests/tcg/multiarch/linux/linux-test.c +++ b/tests/tcg/multiarch/linux/linux-test.c @@ -354,13 +354,17 @@ static void test_pipe(void) if (FD_ISSET(fds[0], &rfds)) { chk_error(read(fds[0], &ch, 1)); rcount++; - if (rcount >= WCOUNT_MAX) + if (rcount >= WCOUNT_MAX) { break; + } } if (FD_ISSET(fds[1], &wfds)) { ch = 'a'; chk_error(write(fds[1], &ch, 1)); wcount++; + if (wcount >= WCOUNT_MAX) { + break; + } } } } |