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

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250: drop DEBUG_AUTOCONF() macro

DEBUG_AUTOCONF() is always disabled (by "#if 0"), so one would need to
recompile the kernel to use it. And even if they did, they would find
out it is broken anyway:
error: variable 'scratch' is used uninitialized whenever 'if' condition is false

Drop it.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250611100319.186924-30-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
15c9dc73 8a48517b

+2 -37
+2 -37
drivers/tty/serial/8250/8250_port.c
··· 39 39 #include "8250.h" 40 40 41 41 /* 42 - * Debugging. 43 - */ 44 - #if 0 45 - #define DEBUG_AUTOCONF(fmt...) printk(fmt) 46 - #else 47 - #define DEBUG_AUTOCONF(fmt...) do { } while (0) 48 - #endif 49 - 50 - /* 51 42 * Here we define the default xmit fifo size used for each type of UART. 52 43 */ 53 44 static const struct serial8250_config uart_config[] = { ··· 816 825 id3 = serial_icr_read(up, UART_ID3); 817 826 rev = serial_icr_read(up, UART_REV); 818 827 819 - DEBUG_AUTOCONF("950id=%02x:%02x:%02x:%02x ", id1, id2, id3, rev); 820 - 821 828 if (id1 == 0x16 && id2 == 0xC9 && 822 829 (id3 == 0x50 || id3 == 0x52 || id3 == 0x54)) { 823 830 up->port.type = PORT_16C950; ··· 839 850 * 0x14 - XR16C854. 840 851 */ 841 852 id1 = autoconfig_read_divisor_id(up); 842 - DEBUG_AUTOCONF("850id=%04x ", id1); 843 853 844 854 id2 = id1 >> 8; 845 855 if (id2 == 0x10 || id2 == 0x12 || id2 == 0x14) { ··· 925 937 if (serial_in(up, UART_EFR) == 0) { 926 938 serial_out(up, UART_EFR, 0xA8); 927 939 if (serial_in(up, UART_EFR) != 0) { 928 - DEBUG_AUTOCONF("EFRv1 "); 929 940 up->port.type = PORT_16650; 930 941 up->capabilities |= UART_CAP_EFR | UART_CAP_SLEEP; 931 942 } else { ··· 937 950 938 951 if (status1 == UART_IIR_FIFO_ENABLED_16750) 939 952 up->port.type = PORT_16550A_FSL64; 940 - else 941 - DEBUG_AUTOCONF("Motorola 8xxx DUART "); 942 953 } 943 954 serial_out(up, UART_EFR, 0); 944 955 return; ··· 948 963 */ 949 964 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 950 965 if (serial_in(up, UART_EFR) == 0 && !broken_efr(up)) { 951 - DEBUG_AUTOCONF("EFRv2 "); 952 966 autoconfig_has_efr(up); 953 967 return; 954 968 } ··· 1010 1026 1011 1027 serial_out(up, UART_LCR, 0); 1012 1028 1013 - DEBUG_AUTOCONF("iir1=%d iir2=%d ", status1, status2); 1014 - 1015 1029 if (status1 == UART_IIR_FIFO_ENABLED_16550A && 1016 1030 status2 == UART_IIR_FIFO_ENABLED_16750) { 1017 1031 up->port.type = PORT_16750; ··· 1038 1056 * It's an Xscale. 1039 1057 * We'll leave the UART_IER_UUE bit set to 1 (enabled). 1040 1058 */ 1041 - DEBUG_AUTOCONF("Xscale "); 1042 1059 up->port.type = PORT_XSCALE; 1043 1060 up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE; 1044 1061 return; 1045 1062 } 1046 - } else { 1047 - /* 1048 - * If we got here we couldn't force the IER_UUE bit to 0. 1049 - * Log it and continue. 1050 - */ 1051 - DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 "); 1052 1063 } 1053 1064 serial_out(up, UART_IER, iersave); 1054 1065 ··· 1072 1097 1073 1098 if (!port->iobase && !port->mapbase && !port->membase) 1074 1099 return; 1075 - 1076 - DEBUG_AUTOCONF("%s: autoconf (0x%04lx, 0x%p): ", 1077 - port->name, port->iobase, port->membase); 1078 1100 1079 1101 /* 1080 1102 * We really do need global IRQs disabled here - we're going to ··· 1119 1147 * We failed; there's nothing here 1120 1148 */ 1121 1149 uart_port_unlock_irqrestore(port, flags); 1122 - DEBUG_AUTOCONF("IER test failed (%02x, %02x) ", 1123 - scratch2, scratch3); 1124 - goto out; 1150 + return; 1125 1151 } 1126 1152 } 1127 1153 ··· 1141 1171 serial8250_out_MCR(up, save_mcr); 1142 1172 if (status1 != (UART_MSR_DCD | UART_MSR_CTS)) { 1143 1173 uart_port_unlock_irqrestore(port, flags); 1144 - DEBUG_AUTOCONF("LOOP test failed (%02x) ", 1145 - status1); 1146 - goto out; 1174 + return; 1147 1175 } 1148 1176 } 1149 1177 ··· 1209 1241 dev_warn(port->dev, "detected caps %08x should be %08x\n", 1210 1242 old_capabilities, up->capabilities); 1211 1243 } 1212 - out: 1213 - DEBUG_AUTOCONF("iir=%d ", scratch); 1214 - DEBUG_AUTOCONF("type=%s\n", uart_config[port->type].name); 1215 1244 } 1216 1245 1217 1246 static void autoconfig_irq(struct uart_8250_port *up)