make generic INIT_C_CC a bit more generic
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 9 Sep 2018 21:57:42 +0000 (17:57 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Sep 2022 08:44:35 +0000 (10:44 +0200)
turn it into an array initializer; then alpha, mips and powerpc
variants fold into it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/YxDm7M6M91gC2RPL@ZenIV
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/alpha/include/asm/termios.h
arch/mips/include/asm/termios.h
arch/powerpc/include/asm/termios.h
include/linux/termios_internal.h

index 9cc784d..3894fd9 100644 (file)
@@ -5,12 +5,4 @@
 #include <linux/uaccess.h>
 #include <uapi/asm/termios.h>
 
-/*     eof=^D          eol=\0          eol2=\0         erase=del
-       werase=^W       kill=^U         reprint=^R      sxtc=\0
-       intr=^C         quit=^\         susp=^Z         <OSF/1 VDSUSP>
-       start=^Q        stop=^S         lnext=^V        discard=^O
-       vmin=\1         vtime=\0
-*/
-#define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\017\001\000"
-
 #endif /* _ALPHA_TERMIOS_H */
index 059c800..12bc568 100644 (file)
 #include <linux/uaccess.h>
 #include <uapi/asm/termios.h>
 
-/*
- *     intr=^C         quit=^\         erase=del       kill=^U
- *     vmin=\1         vtime=\0        eol2=\0         swtc=\0
- *     start=^Q        stop=^S         susp=^Z         vdsusp=
- *     reprint=^R      discard=^O      werase=^W       lnext=^V
- *     eof=^D          eol=\0
- */
-#define INIT_C_CC "\003\034\177\025\1\0\0\0\021\023\032\0\022\017\027\026\004\0"
-
 #endif /* _ASM_TERMIOS_H */
index e18a05a..8379453 100644 (file)
@@ -10,7 +10,4 @@
 
 #include <uapi/asm/termios.h>
 
-/*                   ^C  ^\ del  ^U  ^D   1   0   0   0   0  ^W  ^R  ^Z  ^Q  ^S  ^V  ^O  */
-#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\017"
-
 #endif /* _ASM_POWERPC_TERMIOS_H */
index 7eb3598..8a53141 100644 (file)
        reprint=^R      discard=^O      werase=^W       lnext=^V
        eol2=\0
 */
-#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
+#define INIT_C_CC {            \
+       [VINTR] = 'C'-0x40,     \
+       [VQUIT] = '\\'-0x40,    \
+       [VERASE] = '\177',      \
+       [VKILL] = 'U'-0x40,     \
+       [VEOF] = 'D'-0x40,      \
+       [VSTART] = 'Q'-0x40,    \
+       [VSTOP] = 'S'-0x40,     \
+       [VSUSP] = 'Z'-0x40,     \
+       [VREPRINT] = 'R'-0x40,  \
+       [VDISCARD] = 'O'-0x40,  \
+       [VWERASE] = 'W'-0x40,   \
+       [VLNEXT] = 'V'-0x40,    \
+       [VMIN] = 1 }
 #endif
 
 int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *);