Skip to content

Commit e455ca4

Browse files
arndbpcmoore
authored andcommitted
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>
1 parent ac9a786 commit e455ca4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

include/linux/audit.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ extern unsigned compat_dir_class[];
130130
extern unsigned compat_chattr_class[];
131131
extern unsigned compat_signal_class[];
132132

133-
extern int audit_classify_compat_syscall(int abi, unsigned syscall);
134-
135133
/* audit_names->type values */
136134
#define AUDIT_TYPE_UNKNOWN 0 /* we don't know yet */
137135
#define AUDIT_TYPE_NORMAL 1 /* a "normal" audit record */

include/linux/audit_arch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ enum auditsc_class_t {
2121
AUDITSC_NVALS /* count */
2222
};
2323

24+
extern int audit_classify_compat_syscall(int abi, unsigned syscall);
25+
2426
#endif

kernel/audit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ extern struct tty_struct *audit_get_tty(void);
259259
extern void audit_put_tty(struct tty_struct *tty);
260260

261261
/* audit watch/mark/tree functions */
262-
#ifdef CONFIG_AUDITSYSCALL
263262
extern unsigned int audit_serial(void);
263+
#ifdef CONFIG_AUDITSYSCALL
264264
extern int auditsc_get_stamp(struct audit_context *ctx,
265265
struct timespec64 *t, unsigned int *serial);
266266

0 commit comments

Comments
 (0)