[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tests: Remove unused "wcount" from linux-test.c
From: |
Peter Maydell |
Subject: |
Re: [PATCH] tests: Remove unused "wcount" from linux-test.c |
Date: |
Fri, 20 May 2022 14:21:26 +0100 |
On Fri, 20 May 2022 at 14:16, Brian Cain <bcain@quicinc.com> wrote:
>
> clang reports this variable as 'set but not used'.
>
> Signed-off-by: Brian Cain <bcain@quicinc.com>
> ---
> tests/tcg/multiarch/linux/linux-test.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/tests/tcg/multiarch/linux/linux-test.c
> b/tests/tcg/multiarch/linux/linux-test.c
> index 019d8175ca..d5781bb476 100644
> --- a/tests/tcg/multiarch/linux/linux-test.c
> +++ b/tests/tcg/multiarch/linux/linux-test.c
> @@ -332,12 +332,11 @@ static void test_pipe(void)
> fd_set rfds, wfds;
> int fds[2], fd_max, ret;
> uint8_t ch;
> - int wcount, rcount;
> + int rcount;
>
> chk_error(pipe(fds));
> chk_error(fcntl(fds[0], F_SETFL, O_NONBLOCK));
> chk_error(fcntl(fds[1], F_SETFL, O_NONBLOCK));
> - wcount = 0;
> rcount = 0;
> for(;;) {
> FD_ZERO(&rfds);
> @@ -360,7 +359,6 @@ static void test_pipe(void)
> if (FD_ISSET(fds[1], &wfds)) {
> ch = 'a';
> chk_error(write(fds[1], &ch, 1));
> - wcount++;
> }
> }
> }
Another 'count' related oddity in this test code:
if (rcount >= WCOUNT_MAX)
break;
why do we compare _r_count against _W_COUNT_MAX ?
-- PMM