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

tty: audit: remove unused variable

While building with W=1 we were getting build warning:
drivers/tty/tty_audit.c:149:16: warning: variable 'sessionid' set but not used

The local variable sessionid was only assigned the value of
current->sessionid but was never reused. On further inspection it turned
out that there is no need of audit_get_loginuid() also.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sudip Mukherjee and committed by
Greg Kroah-Hartman
54555919 5f535733

+1 -7
+1 -7
drivers/tty/tty_audit.c
··· 144 144 if (tty_audit_push()) 145 145 return; 146 146 147 - if (audit_enabled) { 148 - kuid_t auid; 149 - unsigned int sessionid; 150 - 151 - auid = audit_get_loginuid(current); 152 - sessionid = audit_get_sessionid(current); 147 + if (audit_enabled) 153 148 tty_audit_log("ioctl=TIOCSTI", dev, &ch, 1); 154 - } 155 149 } 156 150 157 151 /**