From: Andrew Morton <akpm@linux-foundation.org>
To: Arthur Taylor <art@ified.ca>
Cc: linux-kernel@vger.kernel.org, gregkh@suse.de
Subject: Re: [PATCH] vt: Add K_OFF return value to vt_ioctl KDGKBMODE
Date: Thu, 7 Apr 2011 16:12:39 -0700 [thread overview]
Message-ID: <20110407161239.9e89a98c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1300351652.10531.2.camel@art-x200>
On Thu, 17 Mar 2011 01:47:32 -0700
Arthur Taylor <art@ified.ca> wrote:
>
> After adding support for K_OFF in KDSKBMODE, it was forgotten to
> add support for returning it in KDGKBMODE.
>
> Signed-off-by: Arthur Taylor <art@ified.ca>
> ---
> drivers/tty/vt/vt_ioctl.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
> index 937d172..e71477a 100644
> --- a/drivers/tty/vt/vt_ioctl.c
> +++ b/drivers/tty/vt/vt_ioctl.c
> @@ -701,6 +701,7 @@ int vt_ioctl(struct tty_struct *tty,
> uival = ((kbd->kbdmode == VC_RAW) ? K_RAW :
> (kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW :
> (kbd->kbdmode == VC_UNICODE) ? K_UNICODE :
> + (kbd->kbdmode == VC_OFF) ? K_OFF :
> K_XLATE);
OK. Thanks. But. If you come across such monstrosities, please do not
permit them to live.
--- a/drivers/tty/vt/vt_ioctl.c~vt-add-k_off-return-value-to-vt_ioctl-kdgkbmode-fix
+++ a/drivers/tty/vt/vt_ioctl.c
@@ -698,11 +698,23 @@ int vt_ioctl(struct tty_struct *tty,
break;
case KDGKBMODE:
- uival = ((kbd->kbdmode == VC_RAW) ? K_RAW :
- (kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW :
- (kbd->kbdmode == VC_UNICODE) ? K_UNICODE :
- (kbd->kbdmode == VC_OFF) ? K_OFF :
- K_XLATE);
+ switch (kbd->kbdmode) {
+ case VC_RAW:
+ uival = K_RAW;
+ break;
+ case VC_MEDIUMRAW:
+ uival = K_MEDIUMRAW;
+ break;
+ case VC_UNICODE:
+ uival = K_UNICODE;
+ break;
+ case VC_OFF:
+ uival = K_OFF;
+ break;
+ default:
+ uival = K_XLATE;
+ break;
+ }
goto setint;
/* this could be folded into KDSKBMODE, but for compatibility
_
prev parent reply other threads:[~2011-04-07 23:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 8:47 Arthur Taylor
2011-04-07 23:12 ` Andrew Morton [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=20110407161239.9e89a98c.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=art@ified.ca \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.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®