]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
audit: Use str_yes_no() helper function
authorThorsten Blum <thorsten.blum@linux.dev>
Fri, 18 Oct 2024 11:09:46 +0000 (13:09 +0200)
committerPaul Moore <paul@paul-moore.com>
Tue, 22 Oct 2024 23:16:50 +0000 (19:16 -0400)
Remove hard-coded strings by using the helper function str_yes_no().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/auditsc.c

index cd57053b4a6993deaaad2f97407af2db87ade00a..0627e74585cefa3fe494f3344535091b17f2dc52 100644 (file)
@@ -1653,8 +1653,8 @@ static void audit_log_uring(struct audit_context *ctx)
        audit_log_format(ab, "uring_op=%d", ctx->uring_op);
        if (ctx->return_valid != AUDITSC_INVALID)
                audit_log_format(ab, " success=%s exit=%ld",
-                                (ctx->return_valid == AUDITSC_SUCCESS ?
-                                 "yes" : "no"),
+                                str_yes_no(ctx->return_valid ==
+                                           AUDITSC_SUCCESS),
                                 ctx->return_code);
        audit_log_format(ab,
                         " items=%d"
@@ -1696,8 +1696,8 @@ static void audit_log_exit(void)
                        audit_log_format(ab, " per=%lx", context->personality);
                if (context->return_valid != AUDITSC_INVALID)
                        audit_log_format(ab, " success=%s exit=%ld",
-                                        (context->return_valid == AUDITSC_SUCCESS ?
-                                         "yes" : "no"),
+                                        str_yes_no(context->return_valid ==
+                                                   AUDITSC_SUCCESS),
                                         context->return_code);
                audit_log_format(ab,
                                 " a0=%lx a1=%lx a2=%lx a3=%lx items=%d",