14 Star 0 Fork 3

src-openEuler/rt-tests

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rt-tests-cyclictest-Fix-warning-cpu-may-be-used-unin.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
RyanL 提交于 2023-02-23 15:46 +08:00 . Package init
From f70d5f0de62114cfcd8d8b5032138111730665e6 Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Mon, 16 Sep 2019 21:06:28 +0200
Subject: [PATCH 08/10] =?UTF-8?q?rt-tests:=20cyclictest:=20Fix=20=20warnin?=
=?UTF-8?q?g:=20=E2=80=98cpu=E2=80=99=20may=20be=20used=20uninitialized?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 72fb35da3238..3a78912b34f8 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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/rt-tests.git
git@gitee.com:src-openeuler/rt-tests.git
src-openeuler
rt-tests
rt-tests
master

搜索帮助