Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Remove every trace of SERIAL_MAGIC

This means removing support for checking magic in amiserial.c
(SERIAL_PARANOIA_CHECK option), which was checking a magic field which
doesn't currently exist in the struct. That code hasn't built at least
since git.

Removing the definition from the header is safe anyway as that code was
from another driver and not including it.

Signed-off-by: Pascal Terjan <pterjan@google.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20191105192749.67533-1-pterjan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pascal Terjan and committed by
Greg Kroah-Hartman
fba67e8f 487ee861

-89
-1
Documentation/process/magic-number.rst
··· 81 81 ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h`` 82 82 PTY_MAGIC 0x5001 ``drivers/char/pty.c`` 83 83 PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h`` 84 - SERIAL_MAGIC 0x5301 async_struct ``include/linux/serial.h`` 85 84 SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h`` 86 85 SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 87 86 STRIP_MAGIC 0x5303 strip ``drivers/net/strip.c``
-1
Documentation/translations/it_IT/process/magic-number.rst
··· 87 87 ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h`` 88 88 PTY_MAGIC 0x5001 ``drivers/char/pty.c`` 89 89 PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h`` 90 - SERIAL_MAGIC 0x5301 async_struct ``include/linux/serial.h`` 91 90 SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h`` 92 91 SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 93 92 STRIP_MAGIC 0x5303 strip ``drivers/net/strip.c``
-1
Documentation/translations/zh_CN/process/magic-number.rst
··· 70 70 ISICOM_MAGIC 0x4d54 isi_port ``include/linux/isicom.h`` 71 71 PTY_MAGIC 0x5001 ``drivers/char/pty.c`` 72 72 PPP_MAGIC 0x5002 ppp ``include/linux/if_pppvar.h`` 73 - SERIAL_MAGIC 0x5301 async_struct ``include/linux/serial.h`` 74 73 SSTATE_MAGIC 0x5302 serial_state ``include/linux/serial.h`` 75 74 SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h`` 76 75 STRIP_MAGIC 0x5303 strip ``drivers/net/strip.c``
-2
drivers/net/wan/z85230.h
··· 421 421 * Asynchronous Interfacing 422 422 */ 423 423 424 - #define SERIAL_MAGIC 0x5301 425 - 426 424 /* 427 425 * The size of the serial xmit buffer is 1 page, or 4096 bytes 428 426 */
-84
drivers/tty/amiserial.c
··· 22 22 * 23 23 */ 24 24 25 - /* 26 - * Serial driver configuration section. Here are the various options: 27 - * 28 - * SERIAL_PARANOIA_CHECK 29 - * Check the magic number for the async_structure where 30 - * ever possible. 31 - */ 32 - 33 25 #include <linux/delay.h> 34 - 35 - #undef SERIAL_PARANOIA_CHECK 36 26 37 27 /* Set of debugging defines */ 38 28 ··· 122 132 123 133 #define serial_isroot() (capable(CAP_SYS_ADMIN)) 124 134 125 - 126 - static inline int serial_paranoia_check(struct serial_state *info, 127 - char *name, const char *routine) 128 - { 129 - #ifdef SERIAL_PARANOIA_CHECK 130 - static const char *badmagic = 131 - "Warning: bad magic number for serial struct (%s) in %s\n"; 132 - static const char *badinfo = 133 - "Warning: null async_struct for (%s) in %s\n"; 134 - 135 - if (!info) { 136 - printk(badinfo, name, routine); 137 - return 1; 138 - } 139 - if (info->magic != SERIAL_MAGIC) { 140 - printk(badmagic, name, routine); 141 - return 1; 142 - } 143 - #endif 144 - return 0; 145 - } 146 - 147 135 /* some serial hardware definitions */ 148 136 #define SDR_OVRUN (1<<15) 149 137 #define SDR_RBF (1<<14) ··· 157 189 struct serial_state *info = tty->driver_data; 158 190 unsigned long flags; 159 191 160 - if (serial_paranoia_check(info, tty->name, "rs_stop")) 161 - return; 162 - 163 192 local_irq_save(flags); 164 193 if (info->IER & UART_IER_THRI) { 165 194 info->IER &= ~UART_IER_THRI; ··· 173 208 { 174 209 struct serial_state *info = tty->driver_data; 175 210 unsigned long flags; 176 - 177 - if (serial_paranoia_check(info, tty->name, "rs_start")) 178 - return; 179 211 180 212 local_irq_save(flags); 181 213 if (info->xmit.head != info->xmit.tail ··· 745 783 746 784 info = tty->driver_data; 747 785 748 - if (serial_paranoia_check(info, tty->name, "rs_put_char")) 749 - return 0; 750 - 751 786 if (!info->xmit.buf) 752 787 return 0; 753 788 ··· 767 808 struct serial_state *info = tty->driver_data; 768 809 unsigned long flags; 769 810 770 - if (serial_paranoia_check(info, tty->name, "rs_flush_chars")) 771 - return; 772 - 773 811 if (info->xmit.head == info->xmit.tail 774 812 || tty->stopped 775 813 || tty->hw_stopped ··· 788 832 int c, ret = 0; 789 833 struct serial_state *info = tty->driver_data; 790 834 unsigned long flags; 791 - 792 - if (serial_paranoia_check(info, tty->name, "rs_write")) 793 - return 0; 794 835 795 836 if (!info->xmit.buf) 796 837 return 0; ··· 831 878 { 832 879 struct serial_state *info = tty->driver_data; 833 880 834 - if (serial_paranoia_check(info, tty->name, "rs_write_room")) 835 - return 0; 836 881 return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); 837 882 } 838 883 ··· 838 887 { 839 888 struct serial_state *info = tty->driver_data; 840 889 841 - if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer")) 842 - return 0; 843 890 return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); 844 891 } 845 892 ··· 846 897 struct serial_state *info = tty->driver_data; 847 898 unsigned long flags; 848 899 849 - if (serial_paranoia_check(info, tty->name, "rs_flush_buffer")) 850 - return; 851 900 local_irq_save(flags); 852 901 info->xmit.head = info->xmit.tail = 0; 853 902 local_irq_restore(flags); ··· 860 913 { 861 914 struct serial_state *info = tty->driver_data; 862 915 unsigned long flags; 863 - 864 - if (serial_paranoia_check(info, tty->name, "rs_send_xchar")) 865 - return; 866 916 867 917 info->x_char = ch; 868 918 if (ch) { ··· 896 952 printk("throttle %s ....\n", tty_name(tty)); 897 953 #endif 898 954 899 - if (serial_paranoia_check(info, tty->name, "rs_throttle")) 900 - return; 901 - 902 955 if (I_IXOFF(tty)) 903 956 rs_send_xchar(tty, STOP_CHAR(tty)); 904 957 ··· 914 973 #ifdef SERIAL_DEBUG_THROTTLE 915 974 printk("unthrottle %s ....\n", tty_name(tty)); 916 975 #endif 917 - 918 - if (serial_paranoia_check(info, tty->name, "rs_unthrottle")) 919 - return; 920 976 921 977 if (I_IXOFF(tty)) { 922 978 if (info->x_char) ··· 1047 1109 unsigned char control, status; 1048 1110 unsigned long flags; 1049 1111 1050 - if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1051 - return -ENODEV; 1052 1112 if (tty_io_error(tty)) 1053 1113 return -EIO; 1054 1114 ··· 1067 1131 struct serial_state *info = tty->driver_data; 1068 1132 unsigned long flags; 1069 1133 1070 - if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1071 - return -ENODEV; 1072 1134 if (tty_io_error(tty)) 1073 1135 return -EIO; 1074 1136 ··· 1089 1155 */ 1090 1156 static int rs_break(struct tty_struct *tty, int break_state) 1091 1157 { 1092 - struct serial_state *info = tty->driver_data; 1093 1158 unsigned long flags; 1094 - 1095 - if (serial_paranoia_check(info, tty->name, "rs_break")) 1096 - return -EINVAL; 1097 1159 1098 1160 local_irq_save(flags); 1099 1161 if (break_state == -1) ··· 1141 1211 unsigned long flags; 1142 1212 DEFINE_WAIT(wait); 1143 1213 int ret; 1144 - 1145 - if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1146 - return -ENODEV; 1147 1214 1148 1215 if ((cmd != TIOCSERCONFIG) && 1149 1216 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { ··· 1260 1333 struct serial_state *state = tty->driver_data; 1261 1334 struct tty_port *port = &state->tport; 1262 1335 1263 - if (serial_paranoia_check(state, tty->name, "rs_close")) 1264 - return; 1265 - 1266 1336 if (tty_port_close_start(port, tty, filp) == 0) 1267 1337 return; 1268 1338 ··· 1302 1378 struct serial_state *info = tty->driver_data; 1303 1379 unsigned long orig_jiffies, char_time; 1304 1380 int lsr; 1305 - 1306 - if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent")) 1307 - return; 1308 1381 1309 1382 if (info->xmit_fifo_size == 0) 1310 1383 return; /* Just in case.... */ ··· 1361 1440 { 1362 1441 struct serial_state *info = tty->driver_data; 1363 1442 1364 - if (serial_paranoia_check(info, tty->name, "rs_hangup")) 1365 - return; 1366 - 1367 1443 rs_flush_buffer(tty); 1368 1444 shutdown(tty, info); 1369 1445 info->tport.count = 0; ··· 1385 1467 port->tty = tty; 1386 1468 tty->driver_data = info; 1387 1469 tty->port = port; 1388 - if (serial_paranoia_check(info, tty->name, "rs_open")) 1389 - return -ENODEV; 1390 1470 1391 1471 port->low_latency = (port->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 1392 1472