aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-19 19:38:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-23 08:57:43 +0000
commit4659a5a15ee201e582f0e211e7f40bb42bd3a3ed (patch)
tree2eebf851eb68c899c9ab8305870344e0fa262314
parent10f0979fc448c330850e33bc9a010850264aa9f9 (diff)
downloadsrc-4659a5a15ee201e582f0e211e7f40bb42bd3a3ed.tar.gz
src-4659a5a15ee201e582f0e211e7f40bb42bd3a3ed.zip
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)
-rw-r--r--sys/dev/mfi/mfi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 96c63fa3eb61..de62095a36ec 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -3698,7 +3698,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");
@@ -3742,7 +3742,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) {