From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/9] tty: fix unused warning when TCGETX is not defined
Date: Tue, 16 Jun 2009 17:01:02 +0100 [thread overview]
Message-ID: <20090616160058.10041.12590.stgit@t61.ukuu.org.uk> (raw)
In-Reply-To: <20090616155552.10041.63479.stgit@t61.ukuu.org.uk>
From: Mike Frysinger <vapier@gentoo.org>
If TCGETX is not defined, we end up with this warning:
drivers/char/tty_ioctl.c: In function ‘tty_mode_ioctl’:
drivers/char/tty_ioctl.c:950: warning: unused variable ‘ktermx’
Since the variable is only used in one case statement, push it down to
the local case scope.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/char/tty_ioctl.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 8116bb1..b24f6c6 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -947,7 +947,6 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
void __user *p = (void __user *)arg;
int ret = 0;
struct ktermios kterm;
- struct termiox ktermx;
if (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
tty->driver->subtype == PTY_TYPE_MASTER)
@@ -1049,7 +1048,8 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
return ret;
#endif
#ifdef TCGETX
- case TCGETX:
+ case TCGETX: {
+ struct termiox ktermx;
if (real_tty->termiox == NULL)
return -EINVAL;
mutex_lock(&real_tty->termios_mutex);
@@ -1058,6 +1058,7 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
if (copy_to_user(p, &ktermx, sizeof(struct termiox)))
ret = -EFAULT;
return ret;
+ }
case TCSETX:
return set_termiox(real_tty, p, 0);
case TCSETXW:
next prev parent reply other threads:[~2009-06-16 15:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 15:59 [PATCH 0/9] Series short description Alan Cox
2009-06-16 16:00 ` [PATCH 1/9] tty: Fix leaks introduced by the shift to separate ldisc objects Alan Cox
2009-06-16 16:00 ` [PATCH 2/9] ldisc: Make sure the ldisc isn't active when we close it Alan Cox
2009-06-16 16:00 ` [PATCH 3/9] ldisc: debug aids Alan Cox
2009-06-16 16:01 ` Alan Cox [this message]
2009-06-16 16:01 ` [PATCH 5/9] pty: Narrow the race on ldisc locking Alan Cox
2009-06-16 16:01 ` [PATCH 6/9] tty: fix sanity check Alan Cox
2009-06-16 16:01 ` [PATCH 7/9] MAINTAINERS: update 8250 section, give Alan Cox a name Alan Cox
2009-06-16 16:02 ` [PATCH 8/9] atmel_serial: fix hang in set_termios when crtscts is enabled Alan Cox
2009-06-16 16:02 ` [PATCH 9/9] imx: Check for NULL pointer deref before calling tty_encode_baud_rate Alan Cox
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=20090616160058.10041.12590.stgit@t61.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®