Skip to contentSkip to conversation

tty: audit: remove unused variable

PATCH In review Sudip Mukherjee 2 participants 2 messages Feb 24, 2016 – Mar 1, 2016 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 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. On further inspection it turned out that there is no need of audit_get_loginuid() also.

---

v2: audit_get_loginuid() also removed.

 drivers/tty/tty_audit.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/tty/tty_audit.c +1 -7
index 66d53fc..df2d735 100644
@@ -144,14 +144,8 @@ void tty_audit_tiocsti(struct tty_struct *tty, char ch)
 	if (tty_audit_push())
 		return;
 
-	if (audit_enabled) {
-		kuid_t auid;
-		unsigned int sessionid;
-
-		auid = audit_get_loginuid(current);
-		sessionid = audit_get_sessionid(current);
+	if (audit_enabled)
 		tty_audit_log("ioctl=TIOCSTI", dev, &ch, 1);
-	}
 }
 
 /**
Signature · 1 line
1.9.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 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 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.