Skip to contentSkip to conversation

perf tool x86: Remove unnecessary conversion to bool

PATCH In review Jules Irenge 1 participant 1 message Nov 3, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 perf tool x86: Remove unnecessary conversion to bool

coccinelle reports a warning at x86__is_amd_cpu()

WARNING: conversion to bool not needed here

To fix this, the unnecessary bool conversion is removed here

---
 tools/perf/arch/x86/util/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/arch/x86/util/env.c +1 -1
index 3e537ffb1353..5b0db77f8e0f 100644
@@ -15,5 +15,5 @@ bool x86__is_amd_cpu(void)
 	is_amd = env.cpuid && strstarts(env.cpuid, "AuthenticAMD") ? 1 : -1;
 	perf_env__exit(&env);
 ret:
-	return is_amd >= 1 ? true : false;
+	return is_amd >= 1;
 }
Signature · 1 line
2.41.0