drivers/tty/vt/vt_ioctl.c: repair insane ?: expression
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Apr 2011 23:13:01 +0000 (16:13 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 19 Apr 2011 21:39:28 +0000 (14:39 -0700)
Cc: Arthur Taylor <art@ified.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/vt/vt_ioctl.c

index e71477a860c5918b825ea268ba97ca77fdea1cc3..01ccd9e93b7fac03446d544469fc129e920fca93 100644 (file)
@@ -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