From: Peter Hurley <peter@hurleysoftware.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: audit: remove unused variable
Date: Tue, 23 Feb 2016 08:00:08 -0800 [thread overview]
Message-ID: <56CC8208.9020804@hurleysoftware.com> (raw)
In-Reply-To: <1456216211-23509-1-git-send-email-sudipm.mukherjee@gmail.com>
Hi Sudip,
On 02/23/2016 12:30 AM, Sudip Mukherjee wrote:
> 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.
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
> Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
> ---
> drivers/tty/tty_audit.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
> index 66d53fc..81fe3fb 100644
> --- a/drivers/tty/tty_audit.c
> +++ b/drivers/tty/tty_audit.c
> @@ -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);
> }
> }
>
prev parent reply other threads:[~2016-02-23 16:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 8:30 [PATCH] tty: audit: remove unused variable Sudip Mukherjee
2016-02-23 16:00 ` Peter Hurley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56CC8208.9020804@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.