aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-05-03 17:55:24 +0100
committerThomas Huth <thuth@redhat.com>2021-05-14 12:28:01 +0200
commit6c054176dba1c3669f7dbf0f3b6bf9e7245a0dfe (patch)
tree9f22d9ad9d27f82e7a3cd5a1e85a97bc6e09aa05 /tests
parente7b13acdf2bc6f05bbad46f76c7cb63f63426918 (diff)
downloadqemu-6c054176dba1c3669f7dbf0f3b6bf9e7245a0dfe.zip
qemu-6c054176dba1c3669f7dbf0f3b6bf9e7245a0dfe.tar.gz
qemu-6c054176dba1c3669f7dbf0f3b6bf9e7245a0dfe.tar.bz2
tests/qtest/rtc-test: Remove pointless NULL check
In rtc-test.c we know that s is non-NULL because qtest_start() will return a non-NULL value, and we assume this when we pass s to qtest_irq_intercept_in(). So we can drop the initial assignment of NULL and the "if (s)" condition at the end of the function. Fixes: Coverity CID 1432353 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210503165525.26221-3-peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/qtest/rtc-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c
index 402ce2c..8126ab1 100644
--- a/tests/qtest/rtc-test.c
+++ b/tests/qtest/rtc-test.c
@@ -686,7 +686,7 @@ static void periodic_timer(void)
int main(int argc, char **argv)
{
- QTestState *s = NULL;
+ QTestState *s;
int ret;
g_test_init(&argc, &argv, NULL);
@@ -712,9 +712,7 @@ int main(int argc, char **argv)
ret = g_test_run();
- if (s) {
- qtest_quit(s);
- }
+ qtest_quit(s);
return ret;
}