Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

audit: avoid missing-prototype warnings

Building with 'make W=1' reveals two function definitions without
a previous prototype in the audit code:

lib/compat_audit.c:32:5: error: no previous prototype for 'audit_classify_compat_syscall' [-Werror=missing-prototypes]
kernel/audit.c:1813:14: error: no previous prototype for 'audit_serial' [-Werror=missing-prototypes]

The first one needs a declaration from linux/audit.h but cannot
include that header without causing conflicting (compat) syscall number
definitions, so move the it into linux/audit_arch.h.

The second one is declared conditionally based on CONFIG_AUDITSYSCALL
but needed as a local function even when that option is disabled, so
move the declaration out of the #ifdef block.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Arnd Bergmann and committed by
Paul Moore
e455ca40 ac9a7868

+3 -3
-2
include/linux/audit.h
··· 130 130 extern unsigned compat_chattr_class[]; 131 131 extern unsigned compat_signal_class[]; 132 132 133 - extern int audit_classify_compat_syscall(int abi, unsigned syscall); 134 - 135 133 /* audit_names->type values */ 136 134 #define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */ 137 135 #define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */
+2
include/linux/audit_arch.h
··· 21 21 AUDITSC_NVALS /* count */ 22 22 }; 23 23 24 + extern int audit_classify_compat_syscall(int abi, unsigned syscall); 25 + 24 26 #endif
+1 -1
kernel/audit.h
··· 259 259 extern void audit_put_tty(struct tty_struct *tty); 260 260 261 261 /* audit watch/mark/tree functions */ 262 - #ifdef CONFIG_AUDITSYSCALL 263 262 extern unsigned int audit_serial(void); 263 + #ifdef CONFIG_AUDITSYSCALL 264 264 extern int auditsc_get_stamp(struct audit_context *ctx, 265 265 struct timespec64 *t, unsigned int *serial); 266 266