From: Masami Hiramatsu (Google) <[email protected]>

Use a ternary operator for checking IS_ENABLED(CONFIG_64BIT) in the
BTF_KIND_PTR case of fetch_type_from_btf_type() to simplify the code.

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
---
 kernel/trace/trace_probe.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
index 4899aa5f9230..fc62d09ea535 100644
--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -495,10 +495,7 @@ static const char *fetch_type_from_btf_type(struct btf 
*btf,
                return "s64";
        case BTF_KIND_PTR:
                /* pointer will be converted to "x??" */
-               if (IS_ENABLED(CONFIG_64BIT))
-                       return "x64";
-               else
-                       return "x32";
+               return IS_ENABLED(CONFIG_64BIT) ? "x64" : "x32";
        case BTF_KIND_INT:
                intdata = btf_type_int(type);
                if (BTF_INT_ENCODING(intdata) & BTF_INT_SIGNED) {


Reply via email to