Skip to contentSkip to conversation

perf: Fix up build failure due to bpf changes

PATCH Superseded Mark Brown 1 participant 2 messages Jun 17

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 perf: Fix up build failure due to bpf changes

Fix

util/btf.c: In function '__btf_type__find_member_by_name':
util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
19 | for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
| ^
cc1: all warnings being treated as errors

by making the variable the same type as the function.

---
 tools/perf/util/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/btf.c +1 -1
index bb163fe87767c..50d98f3e83bf0 100644
@@ -14,7 +14,7 @@ const struct btf_member *__btf_type__find_member_by_name(struct btf *btf,
 {
 	const struct btf_type *t = btf__type_by_id(btf, type_id);
 	const struct btf_member *m;
-	int i;
+	u32 i;
 
 	for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
 		const char *current_member_name = btf__name_by_offset(btf, m->name_off);
Signature · 1 line
2.47.3
author
#1 lore raw
Quoted 6 lines · Mark Brown

Fix

util/btf.c: In function '__btf_type__find_member_by_name':
util/btf.c:19:43: error: comparison of integer expressions of different signedness: 'int' and '__u32' {aka 'unsigned int'} [-Werror=sign-compare]
19 | for (i = 0, m = btf_members(t); i < btf_vlen(t); i++, m++) {
| ^

Gah, there's another one which I will also fix up - I'll send a v2 in a minute.