Skip to contentSkip to conversation

audit: fix coding style issues

PATCH Applied Ricardo Robaina 2 participants 3 messages Mar 3 – Mar 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audit: fix coding style issues

Fix various coding style issues across the audit subsystem flagged by checkpatch.pl script to adhere to kernel coding standards.

Specific changes include:
- kernel/auditfilter.c: Move the open brace '{' to the previous line for the audit_ops array declaration.
- lib/audit.c: Add a required space before the open parenthesis '('.
- include/uapi/linux/audit.h: Enclose the complex macro value for AUDIT_UID_UNSET in parentheses.

---
 include/uapi/linux/audit.h | 2 +-
 kernel/auditfilter.c       | 3 +--
 lib/audit.c                | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)
include/uapi/linux/audit.h +1 -1
index 14a1c1fe013a..de4015430476 100644
@@ -508,7 +508,7 @@ struct audit_tty_status {
 	__u32		log_passwd;	/* 1 = enabled, 0 = disabled */
 };
 
-#define AUDIT_UID_UNSET (unsigned int)-1
+#define AUDIT_UID_UNSET ((unsigned int)-1)
 #define AUDIT_SID_UNSET ((unsigned int)-1)
 
 /* audit_rule_data supports filter rules with both integer and string
kernel/auditfilter.c +1 -2
index 6e3abbf08e3d..093425123f6c 100644
@@ -303,8 +303,7 @@ static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *
 	return ERR_PTR(err);
 }
 
-static u32 audit_ops[] =
-{
+static u32 audit_ops[] = {
 	[Audit_equal] = AUDIT_EQUAL,
 	[Audit_not_equal] = AUDIT_NOT_EQUAL,
 	[Audit_bitmask] = AUDIT_BIT_MASK,
lib/audit.c +1 -1
index 738bda22dd39..bc07fbd3a698 100644
@@ -42,7 +42,7 @@ int audit_classify_syscall(int abi, unsigned syscall)
 	if (audit_is_compat(abi))
 		return audit_classify_compat_syscall(abi, syscall);
 
-	switch(syscall) {
+	switch (syscall) {
 #ifdef __NR_open
 	case __NR_open:
 		return AUDITSC_OPEN;
Signature · 1 line
2.53.0
maintainer Applied
#1 lore raw
Quoted 11 lines · On Mar 3, 2026 Ricardo Robaina <[email protected]> wrote:

Fix various coding style issues across the audit subsystem flagged by checkpatch.pl script to adhere to kernel coding standards.

Specific changes include:
- kernel/auditfilter.c: Move the open brace '{' to the previous line for the audit_ops array declaration.
- lib/audit.c: Add a required space before the open parenthesis '('.
- include/uapi/linux/audit.h: Enclose the complex macro value for AUDIT_UID_UNSET in parentheses.

Quoted 6 lines
---
 include/uapi/linux/audit.h | 2 +-
 kernel/auditfilter.c       | 3 +--
 lib/audit.c                | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

Merged into audit/dev, thanks.

--
paul-moore.com

#2 lore raw

Thanks, Paul!

Quoted 25 lines · Paul Moore
Quoted 11 lines · On Mar 3, 2026 Ricardo Robaina <[email protected]> wrote:

Fix various coding style issues across the audit subsystem flagged by checkpatch.pl script to adhere to kernel coding standards.

Specific changes include:
- kernel/auditfilter.c: Move the open brace '{' to the previous line for the audit_ops array declaration.
- lib/audit.c: Add a required space before the open parenthesis '('.
- include/uapi/linux/audit.h: Enclose the complex macro value for AUDIT_UID_UNSET in parentheses.

Quoted 6 lines
---
 include/uapi/linux/audit.h | 2 +-
 kernel/auditfilter.c       | 3 +--
 lib/audit.c                | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

Merged into audit/dev, thanks.

--
paul-moore.com