git: 864ff7a6e505 - stable/13 - Suppress unused variable warning in mfi.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 23 Jul 2022 08:58:21 UTC
The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=864ff7a6e5051f83146c229634126d28307a3900 commit 864ff7a6e5051f83146c229634126d28307a3900 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2022-07-19 19:38:41 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2022-07-23 08:56:45 +0000 Suppress unused variable warning in mfi.c With clang 15, the following -Werror warnings are produced: sys/dev/mfi/mfi.c:3698:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable] int timedout; ^ sys/dev/mfi/mfi.c:3742:6: error: variable 'timedout' set but not used [-Werror,-Wunused-but-set-variable] int timedout = 0; ^ Here, 'timedout' are variables that are only used when debugging, requiring #if 0 statements to be modified. Mark the variables as potentially unused, to suppress the warnings. MFC after: 3 days (cherry picked from commit 3dbe05f61b65a73582aefdc2ee5a50ad2b4390ef) --- sys/dev/mfi/mfi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c index 4b7d42877d0e..1b26c194400f 100644 --- a/sys/dev/mfi/mfi.c +++ b/sys/dev/mfi/mfi.c @@ -3697,7 +3697,7 @@ mfi_dump_all(void) struct mfi_command *cm; devclass_t dc; time_t deadline; - int timedout; + int timedout __unused; int i; dc = devclass_find("mfi"); @@ -3741,7 +3741,7 @@ mfi_timeout(void *data) struct mfi_softc *sc = (struct mfi_softc *)data; struct mfi_command *cm, *tmp; time_t deadline; - int timedout = 0; + int timedout __unused = 0; deadline = time_uptime - mfi_cmd_timeout; if (sc->adpreset == 0) {