[PATCH] linux-test.c: Remove unused but set variable

Taylor Simpson posted 1 patch 1 year, 4 months ago
Failed in applying to current master (apply log)
tests/tcg/multiarch/linux/linux-test.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH] linux-test.c: Remove unused but set variable
Posted by Taylor Simpson 1 year, 4 months ago
Some versions of clang will warn on this with -Wall
Then, it will be an error with -Werror

Signed-off-by: Taylor Simpson <tsimpson@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 5a2a4f2258..10943d5310 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++;
             }
         }
     }
-- 
2.17.1

RE: [PATCH] linux-test.c: Remove unused but set variable
Posted by Brian Cain 1 year, 4 months ago
> -----Original Message-----
> From: Taylor Simpson <tsimpson@quicinc.com>
> Sent: Thursday, January 5, 2023 10:24 AM
> To: qemu-devel@nongnu.org; alex.bennee@linaro.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Brian Cain
> <bcain@quicinc.com>; Matheus Bernardino (QUIC)
> <quic_mathbern@quicinc.com>
> Subject: [PATCH] linux-test.c: Remove unused but set variable
> 
> Some versions of clang will warn on this with -Wall
> Then, it will be an error with -Werror

This change landed with 9804dcd2719a44d90982e61d466213e522c854ef

https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213e522c854ef
RE: [PATCH] linux-test.c: Remove unused but set variable
Posted by Brian Cain 1 year, 4 months ago
> -----Original Message-----
> From: Brian Cain
> Sent: Thursday, January 5, 2023 11:10 AM
> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org;
> alex.bennee@linaro.org
> Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Matheus Bernardino (QUIC)
> <quic_mathbern@quicinc.com>
> Subject: RE: [PATCH] linux-test.c: Remove unused but set variable
> 
> > -----Original Message-----
> > From: Taylor Simpson <tsimpson@quicinc.com>
> > Sent: Thursday, January 5, 2023 10:24 AM
> > To: qemu-devel@nongnu.org; alex.bennee@linaro.org
> > Cc: Taylor Simpson <tsimpson@quicinc.com>; richard.henderson@linaro.org;
> > philmd@linaro.org; ale@rev.ng; anjo@rev.ng; Brian Cain
> > <bcain@quicinc.com>; Matheus Bernardino (QUIC)
> > <quic_mathbern@quicinc.com>
> > Subject: [PATCH] linux-test.c: Remove unused but set variable
> >
> > Some versions of clang will warn on this with -Wall
> > Then, it will be an error with -Werror
> 
> This change landed with 9804dcd2719a44d90982e61d466213e522c854ef

Rather: the effective fix for this issue is present.  Maybe the container registry was updated and you would see this problem when building commits older than 9804dcd2719a44d90982e61d466213e522c854ef  with the new container?

> https://github.com/qemu/qemu/commit/9804dcd2719a44d90982e61d466213
> e522c854ef
Re: [PATCH] linux-test.c: Remove unused but set variable
Posted by Peter Maydell 1 year, 4 months ago
On Thu, 5 Jan 2023 at 16:24, Taylor Simpson <tsimpson@quicinc.com> wrote:
>
> Some versions of clang will warn on this with -Wall
> Then, it will be an error with -Werror

I think this has already been fixed by commit 2bc6c79417b89c3306.

thanks
-- PMM