summaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_audit.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@kernel.org>2023-06-21 12:16:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-06-21 17:57:29 +0200
commite64ed44bce43e003dd154c0bc418a431c15bdf77 (patch)
treea0da85b38568c7d62cf34133a180ff9a091e4f6d /drivers/tty/tty_audit.c
parenttty_audit: make icanon a bool (diff)
downloadlinux-e64ed44bce43e003dd154c0bc418a431c15bdf77.tar.xz
linux-e64ed44bce43e003dd154c0bc418a431c15bdf77.zip
tty_audit: make tty pointers in exposed functions const
Both tty_audit_add_data() and tty_audit_tiocsti() need only to read from the tty struct, so make the tty parameters of them both const. This aids the compiler a bit. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20230621101611.10580-6-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_audit.c')
-rw-r--r--drivers/tty/tty_audit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index 6cf8b63368ee..5cbe28ac1763 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -134,7 +134,7 @@ void tty_audit_fork(struct signal_struct *sig)
/*
* tty_audit_tiocsti - Log TIOCSTI
*/
-void tty_audit_tiocsti(struct tty_struct *tty, char ch)
+void tty_audit_tiocsti(const struct tty_struct *tty, char ch)
{
dev_t dev;
@@ -199,7 +199,8 @@ static struct tty_audit_buf *tty_audit_buf_get(void)
*
* Audit @data of @size from @tty, if necessary.
*/
-void tty_audit_add_data(struct tty_struct *tty, const void *data, size_t size)
+void tty_audit_add_data(const struct tty_struct *tty, const void *data,
+ size_t size)
{
struct tty_audit_buf *buf;
unsigned int audit_tty;