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

tty: audit: move some local functions out of tty.h

The functions tty_audit_add_data() and tty_audit_tiocsti() are local to
the tty core code, and do not need to be in a "kernel-wide" header file
so move them to drivers/tty/tty.h

Cc: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20210408125134.3016837-9-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+15 -10
+14
drivers/tty/tty.h
··· 17 17 #define tty_info_ratelimited(tty, f, ...) \ 18 18 tty_msg(pr_info_ratelimited, tty, f, ##__VA_ARGS__) 19 19 20 + /* tty_audit.c */ 21 + #ifdef CONFIG_AUDIT 22 + void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size); 23 + void tty_audit_tiocsti(struct tty_struct *tty, char ch); 24 + #else 25 + static inline void tty_audit_add_data(struct tty_struct *tty, const void *data, 26 + size_t size) 27 + { 28 + } 29 + static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) 30 + { 31 + } 32 + #endif 33 + 20 34 #endif
+1
drivers/tty/tty_audit.c
··· 10 10 #include <linux/audit.h> 11 11 #include <linux/slab.h> 12 12 #include <linux/tty.h> 13 + #include "tty.h" 13 14 14 15 struct tty_audit_buf { 15 16 struct mutex mutex; /* Protects all data below */
-10
include/linux/tty.h
··· 717 717 718 718 /* tty_audit.c */ 719 719 #ifdef CONFIG_AUDIT 720 - extern void tty_audit_add_data(struct tty_struct *tty, const void *data, 721 - size_t size); 722 720 extern void tty_audit_exit(void); 723 721 extern void tty_audit_fork(struct signal_struct *sig); 724 - extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 725 722 extern int tty_audit_push(void); 726 723 #else 727 - static inline void tty_audit_add_data(struct tty_struct *tty, const void *data, 728 - size_t size) 729 - { 730 - } 731 - static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) 732 - { 733 - } 734 724 static inline void tty_audit_exit(void) 735 725 { 736 726 }