]> xenbits.xensource.com Git - people/aperard/qemu-dm.git/commitdiff
tests/tcg: fix unused variable in linux-test
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 21 Dec 2022 09:04:09 +0000 (09:04 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Fri, 23 Dec 2022 15:15:57 +0000 (15:15 +0000)
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>

tests/tcg/multiarch/linux/linux-test.c

index 5a2a4f2258c703dae74f6b5fbf720510bdfca8a3..64f57cb287eb280b49586feef6e08f83eead40c3 100644 (file)
@@ -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;
+                }
             }
         }
     }