tty: audit: remove unused variable
PATCH 1/1 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.
Signed-off-by Sudip Mukherjee <[email protected]>
--- drivers/tty/tty_audit.c | 2 -- 1 file changed, 2 deletions(-)
drivers/tty/tty_audit.c +0 -2
@@ -146,10 +146,8 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch)if (audit_enabled) {kuid_t auid; -unsigned int sessionid; auid =audit_get_loginuid (current); - sessionid =audit_get_sessionid (current);tty_audit_log ("ioctl=TIOCSTI" , dev, &ch,1 ); } }
Signature · 1 line
1.9.1
Hi Sudip,
Quoted 5 lines · Sudip Mukherjee
While building with W=1 we were getting build warning:
drivers/tty/tty_audit.c:149:16: warning: variable 'sessionid' set but not usedThe local variable sessionid was only assigned the value of
current->sessionidbut was never reused.
Thanks for catching this.
While reviewing this patch, I noticed entire if clause can be reduced to
if (audit_enabled)
tty_audit_log("ioctl=TIOCSTI", dev, &ch, 1);since auid is unused variable as well.
Regards,
Peter Hurley
Quoted 21 lines
Signed-off-by Sudip Mukherjee <[email protected]>--- drivers/tty/tty_audit.c | 2 -- 1 file changed, 2 deletions(-)drivers/tty/tty_audit.c +0
-2@@ -146,10 +146,8 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch)if (audit_enabled) {kuid_t auid; -unsigned int sessionid; auid =audit_get_loginuid (current); - sessionid =audit_get_sessionid (current);tty_audit_log ("ioctl=TIOCSTI" , dev, &ch,1 ); } }