diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-06-16 12:01:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 15:01:16 -0400 |
commit | 5dca607bcf10d3f08d07ffeac664c6769c336145 (patch) | |
tree | 73cb2d253b0ab4bd2501fb2bf1caf88f1d47f698 /drivers/char/tty_ioctl.c | |
parent | 677ca3060c474d7d89941948e32493d9c18c52d2 (diff) |
tty: fix unused warning when TCGETX is not defined
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_ioctl.c')
-rw-r--r-- | 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 8116bb1c8f80..b24f6c6a1ea3 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, | |||
947 | void __user *p = (void __user *)arg; | 947 | void __user *p = (void __user *)arg; |
948 | int ret = 0; | 948 | int ret = 0; |
949 | struct ktermios kterm; | 949 | struct ktermios kterm; |
950 | struct termiox ktermx; | ||
951 | 950 | ||
952 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && | 951 | if (tty->driver->type == TTY_DRIVER_TYPE_PTY && |
953 | tty->driver->subtype == PTY_TYPE_MASTER) | 952 | tty->driver->subtype == PTY_TYPE_MASTER) |
@@ -1049,7 +1048,8 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | |||
1049 | return ret; | 1048 | return ret; |
1050 | #endif | 1049 | #endif |
1051 | #ifdef TCGETX | 1050 | #ifdef TCGETX |
1052 | case TCGETX: | 1051 | case TCGETX: { |
1052 | struct termiox ktermx; | ||
1053 | if (real_tty->termiox == NULL) | 1053 | if (real_tty->termiox == NULL) |
1054 | return -EINVAL; | 1054 | return -EINVAL; |
1055 | mutex_lock(&real_tty->termios_mutex); | 1055 | mutex_lock(&real_tty->termios_mutex); |
@@ -1058,6 +1058,7 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file, | |||
1058 | if (copy_to_user(p, &ktermx, sizeof(struct termiox))) | 1058 | if (copy_to_user(p, &ktermx, sizeof(struct termiox))) |
1059 | ret = -EFAULT; | 1059 | ret = -EFAULT; |
1060 | return ret; | 1060 | return ret; |
1061 | } | ||
1061 | case TCSETX: | 1062 | case TCSETX: |
1062 | return set_termiox(real_tty, p, 0); | 1063 | return set_termiox(real_tty, p, 0); |
1063 | case TCSETXW: | 1064 | case TCSETXW: |