From: John Kacur <jkacur@redhat.com>
To: rt-users <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [PATCH 3/4] rt-tests: cyclictest: Fix warning: ‘cpu’ may be used uninitialized
Date: Mon, 16 Sep 2019 23:51:10 +0200 [thread overview]
Message-ID: <20190916215111.10193-3-jkacur@redhat.com> (raw)
In-Reply-To: <20190916215111.10193-1-jkacur@redhat.com>
Fix warning 'cpu' maybe uninitialized by giving it a default value in
the switch statement. Note, this is a false positive, but documenting
the default value in the switch statement isn't a bad thing.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
src/cyclictest/cyclictest.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 45b6041ec1c9..542e85c27a25 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -1897,6 +1897,7 @@ int main(int argc, char **argv)
printf("Thread %d using cpu %d.\n", i, cpu);
break;
case AFFINITY_USEALL: cpu = i % max_cpus; break;
+ default: cpu = -1;
}
node = -1;
--
2.20.1
next prev parent reply other threads:[~2019-09-16 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 21:51 [PATCH 1/4] rt-tests: cyclictest.8: Remove invalid tracing options from the manpage John Kacur
2019-09-16 21:51 ` [PATCH 2/4] rt-tests: cyclictest: Make tracemark work correctly again John Kacur
2019-09-17 7:21 ` Kurt Kanzenbach
2019-09-17 14:20 ` John Kacur
2019-09-16 21:51 ` John Kacur [this message]
2019-09-16 21:51 ` [PATCH 4/4] rt-tests: cyclictest: Don't allow OPT_SYSTEM with OPT_POSIX_TIMERS John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190916215111.10193-3-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).