audit: avoid missing-prototype warnings
authorArnd Bergmann <arnd@arndb.de>
Wed, 17 May 2023 13:10:52 +0000 (15:10 +0200)
committerPaul Moore <paul@paul-moore.com>
Wed, 17 May 2023 15:34:55 +0000 (11:34 -0400)
commite455ca40dbcf2cd50d1e59bf4b2752b300bcdad4
treea12e20f3800995df1d3afbdece712ac6ed94ca0e
parentac9a78681b921877518763ba0e89202254349d1b
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>
include/linux/audit.h
include/linux/audit_arch.h
kernel/audit.h