drivers/tty/serial: fix Kconfig issues in crisv10.c
cover drivers/tty/serial: fix Kconfig issues in crisv10.c
This small patch set addresses various Kconfig related issues in crisv10.c such as fixing naming conventions and removing dead code. The dead code did not compile for years so I assume that it can be removed safely.
Please note that I am not able to test compile these changes. I detected all issues with scripts/checkkconfigsymbols.py
Valentin Rothberg (4):
drivers/tty/serial/crisv10.c: remove dead #ifdef block drivers/tty/serial/crisv10.c: remove dead #ifdef blocks drivers/tty/serial/crisv10.c: remove dead #ifdef blocks drivers/tty/serial/crisv10.c: rename CPP identifier
CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED
drivers/tty/serial/crisv10.c | 86 +++----------------------------------------- 1 file changed, 4 insertions(+), 82 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/4 drivers/tty/serial/crisv10.c: remove dead #ifdef block
ETRAX_EXTERN_PB6CLK_ENABLED is not defined in Kconfig. The affected
#ifdef block has not been compiled for years, so remove it entirely.
--- drivers/tty/serial/crisv10.c | 13 ------------- 1 file changed, 13 deletions(-)
drivers/tty/serial/crisv10.c +0 -13
@@ -2867,19 +2867,6 @@ change_speed(struct e100_serial *info) *R_SERIAL_PRESCALE = divisor; info->baud =SERIAL_PRESCALE_BASE /divisor; } -#ifdef CONFIG_ETRAX_EXTERN_PB6CLK_ENABLED - else if ((info->baud_base==CONFIG_ETRAX_EXTERN_PB6CLK_FREQ/8 && - info->custom_divisor == 1) || - (info->baud_base==CONFIG_ETRAX_EXTERN_PB6CLK_FREQ && - info->custom_divisor == 8)) { -/* ext_clk selected */ - alt_source = -IO_STATE (R_ALT_SER_BAUDRATE , ser0_rec, extern) | -IO_STATE (R_ALT_SER_BAUDRATE , ser0_tr, extern); -DBAUD (printk ("using external baudrate: %lu\n" ,CONFIG_ETRAX_EXTERN_PB6CLK_FREQ /8 )); - info->baud =CONFIG_ETRAX_EXTERN_PB6CLK_FREQ /8 ; - } -#endif else {/* Bad baudbase, we don't support using timer0
Signature · 1 line
2.1.0
PATCH 2/4 drivers/tty/serial/crisv10.c: remove dead #ifdef blocks
In reply to Valentin RothbergETRAX_RS485_{ON_PORT_G, LTC1387} are not defined in Kconfig. The affected #ifdef block have not been compiled for years, so remove them entirely.
--- drivers/tty/serial/crisv10.c | 36 ------------------------------------ 1 file changed, 36 deletions(-)
drivers/tty/serial/crisv10.c +0 -36
@@ -56,10 +56,6 @@ static char *serial_version = "$Revision: 1.25 $";#error "RX_TIMEOUT_TICKS == 0 not allowed, use 1"#endif -#if defined(CONFIG_ETRAX_RS485_ON_PA ) && defined(CONFIG_ETRAX_RS485_ON_PORT_G ) -#error "Disable either CONFIG_ETRAX_RS485_ON_PA or CONFIG_ETRAX_RS485_ON_PORT_G" -#endif -/* * All of the compatibilty code so we can compile serial.c against * older kernels is hidden in serial_compat.h
@@ -487,9 +483,6 @@ static struct fast_timer fast_timers_rs485[NR_PORTS];#if defined(CONFIG_ETRAX_RS485_ON_PA )static int rs485_pa_bit =CONFIG_ETRAX_RS485_ON_PA_BIT ;#endif -#if defined(CONFIG_ETRAX_RS485_ON_PORT_G ) -static int rs485_port_g_bit =CONFIG_ETRAX_RS485_ON_PORT_G_BIT ; -#endif #endif /* Info and macros needed for each ports extra control/status signals. */
@@ -1367,16 +1360,6 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r)#if defined(CONFIG_ETRAX_RS485_ON_PA ) *R_PORT_PA_DATA = port_pa_data_shadow |= (1 << rs485_pa_bit);#endif -#if defined(CONFIG_ETRAX_RS485_ON_PORT_G ) -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, - rs485_port_g_bit,1 ); -#endif -#if defined(CONFIG_ETRAX_RS485_LTC1387 ) -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, -CONFIG_ETRAX_RS485_LTC1387_DXEN_PORT_G_BIT ,1 ); -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, -CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT ,1 ); -#endif info->rs485 = *r;
@@ -3712,16 +3695,6 @@ rs_close(struct tty_struct *tty, struct file * filp)#if defined(CONFIG_ETRAX_RS485_ON_PA ) *R_PORT_PA_DATA = port_pa_data_shadow &= ~(1 << rs485_pa_bit); #endif -#if defined(CONFIG_ETRAX_RS485_ON_PORT_G ) -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, - rs485_port_g_bit,0 ); -#endif -#if defined(CONFIG_ETRAX_RS485_LTC1387 ) -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, -CONFIG_ETRAX_RS485_LTC1387_DXEN_PORT_G_BIT ,0 ); -REG_SHADOW_SET (R_PORT_G_DATA , port_g_data_shadow, -CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT ,0 ); -#endif }#endif
@@ -4250,15 +4223,6 @@ static int __init rs_init(void)return -EBUSY ; }#endif -#if defined(CONFIG_ETRAX_RS485_ON_PORT_G ) -if (cris_io_interface_allocate_pins (if_serial_0,'g' , rs485_pa_bit, - rs485_port_g_bit)) { -printk (KERN_ERR "ETRAX100LX serial: Could not allocate " -"RS485 pin\n" ); -put_tty_driver (driver); -return -EBUSY ; - } -#endif #endif /* Initialize the tty_driver structure */
Signature · 1 line
2.1.0
PATCH 3/4 drivers/tty/serial/crisv10.c: remove dead #ifdef blocks
In reply to Valentin RothbergETRAX_SERIAL_PROC_ENTRY is not defined in Kconfig. The affected #ifdef block has not been compiled for years, and the embedded macro, PROCSTAT, ended up as a NOOP. Hence, remove the block and all calls to PROCSTAT.
--- drivers/tty/serial/crisv10.c | 29 ----------------------------- 1 file changed, 29 deletions(-)
drivers/tty/serial/crisv10.c +0 -29
@@ -451,30 +451,6 @@ static struct e100_serial rs_table[] = {static struct fast_timer fast_timers[NR_PORTS ];#endif -#ifdef CONFIG_ETRAX_SERIAL_PROC_ENTRY -#define PROCSTAT (x) x -struct ser_statistics_type { -int overrun_cnt; -int early_errors_cnt; -int ser_ints_ok_cnt; -int errors_cnt; -unsigned long int processing_flip; -unsigned long processing_flip_still_room; -unsigned long int timeout_flush_cnt; -int rx_dma_ints; -int tx_dma_ints; -int rx_tot; -int tx_tot; -}; - -static struct ser_statistics_type ser_stat[NR_PORTS ]; - -#else - -#define PROCSTAT (x) - -#endif /* CONFIG_ETRAX_SERIAL_PROC_ENTRY */ -/* RS-485 */ #if defined(CONFIG_ETRAX_RS485 )#ifdef CONFIG_ETRAX_FAST_TIMER
@@ -1824,7 +1800,6 @@ static void receive_chars_dma(struct e100_serial *info)*/ unsigned char data = info->ioport[REG_DATA ]; -PROCSTAT (ser_stat[info->line].errors_cnt++);DEBUG_LOG (info->line,"#dERR: s d 0x%04X\n" , ((rstat &SER_ERROR_MASK ) <<8 ) | data);
@@ -1926,7 +1901,6 @@ tr_interrupt(int irq, void *dev_id)/* Read jiffies_usec first, * we want this time to be as late as possible */ -PROCSTAT (ser_stat[info->line].tx_dma_ints++); info->last_tx_active_usec =GET_JIFFIES_USEC (); info->last_tx_active = jiffies;transmit_chars_dma (info);
@@ -2005,7 +1979,6 @@ static int force_eop_if_needed(struct e100_serial *info)*/ if (!info->forced_eop) { info->forced_eop =1 ; -PROCSTAT (ser_stat[info->line].timeout_flush_cnt++);TIMERD (DEBUG_LOG (info->line,"timeout EOP %i\n" , info->line));FORCE_EOP (info); }
@@ -2357,7 +2330,6 @@ static void handle_ser_rx_interrupt(struct e100_serial *info)DEBUG_LOG (info->line,"#iERR s d %04X\n" , ((rstat &SER_ERROR_MASK ) <<8 ) | data); } -PROCSTAT (ser_stat[info->line].early_errors_cnt++); }else {/* It was a valid byte, now let the DMA do the rest */ unsigned long curr_time_u =GET_JIFFIES_USEC ();unsigned long curr_time = jiffies;
@@ -2390,7 +2362,6 @@ static void handle_ser_rx_interrupt(struct e100_serial *info)DINTR2 (DEBUG_LOG (info->line,"ser_rx OK %d\n" , info->line)); info->break_detected_cnt =0 ; -PROCSTAT (ser_stat[info->line].ser_ints_ok_cnt++); }/* Restarting the DMA never hurts */ *info->icmdadr =IO_STATE (R_DMA_CH6_CMD , cmd, restart);
Signature · 1 line
2.1.0
PATCH 4/4 drivers/tty/serial/crisv10.c: rename CPP identifier CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED
In reply to Valentin RothbergThe 'CONFIG_' prefix is reserved for Kconfig options in Make and CPP syntax only. Remove this prefix from the self-defined CPP identifier to apply to this convention and make static analysis tools happy.
--- drivers/tty/serial/crisv10.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/tty/serial/crisv10.c +4 -4
@@ -708,10 +708,10 @@ static unsigned char dummy_ser[NR_PORTS] = {0xFF, 0xFF, 0xFF,0xFF};defined (CONFIG_ETRAX_SER1_DTR_RI_DSR_CD_MIXED ) || \defined (CONFIG_ETRAX_SER2_DTR_RI_DSR_CD_MIXED ) || \ defined(CONFIG_ETRAX_SER3_DTR_RI_DSR_CD_MIXED) -#define CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED +#define ETRAX_SERX_DTR_RI_DSR_CD_MIXED #endif -#ifdef CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED +#ifdef ETRAX_SERX_DTR_RI_DSR_CD_MIXED /* The pins can be mixed on PA and PB */ #define CONTROL_PINS_PORT_NOT_USED (line) \ &dummy_ser[line], &dummy_ser[line], \
@@ -804,7 +804,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] =#endif } }; -#else /* CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED */ +#else /* ETRAX_SERX_DTR_RI_DSR_CD_MIXED */ /* All pins are on either PA or PB for each serial port */ #define CONTROL_PINS_PORT_NOT_USED (line) \
@@ -886,7 +886,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] = #endif } }; -#endif /* !CONFIG_ETRAX_SERX_DTR_RI_DSR_CD_MIXED */ +#endif /* !ETRAX_SERX_DTR_RI_DSR_CD_MIXED */ #define E100_RTS_MASK 0x20#define E100_CTS_MASK 0x40
Signature · 1 line
2.1.0