Skip to contentSkip to conversation

audit: Use str_yes_no() helper function

PATCH Applied Thorsten Blum 2 participants 2 messages Oct 18, 2024 – Oct 22, 2024 Audit

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audit: Use str_yes_no() helper function

Remove hard-coded strings by using the helper function str_yes_no().

---
 kernel/auditsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/auditsc.c +4 -4
index cd57053b4a69..0627e74585ce 100644
@@ -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",
Signature · 1 line
2.47.0
maintainer Applied
#1 lore raw
Quoted 7 lines · On Oct 18, 2024 Thorsten Blum <[email protected]> wrote:

Remove hard-coded strings by using the helper function str_yes_no().

---
 kernel/auditsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Merged into audit/dev, thanks.

--
paul-moore.com