Removing dead code
cover Removing dead code
Hi all!
As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux' configuration system.
I've been running a check on the arch/arm sourcetree for
config Items not defined in Kconfig and found 33 such cases. Sourcecode
blocks depending on these Items are not reachable from a vanilla kernel -- dead code. I've seen such dead blocks made on purpose e.g. while integrating new features into the kernel but generally they're just useless.
Each of the patches in this patchset removes on such dead
config Item, I'd be glad if you consider applying them. I've been doing deeper analysis of such issues before and can do so again but I'm not so sure they were fastly usefull. Unfortunately arm doesn't allow some allyesconfig build covering all of that code so I couldn't build-test all of them, sorry for that.
Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.
Regards
Christoph Egger
[0] http://vamos1.informatik.uni-erlangen.de/
Christoph Egger (11):
Removing dead 68328_SERIAL_UART
Removing dead CONSOLE_*
Removing dead PP04
Removing dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) Removing dead ETRAX_RS485_ON_PORT_G Removing dead ETRAX_RS485_LTC1387
Removing dead ETRAX_EXTERN_PB6CLK_ENABLED Removing dead ETRAX_SERIAL_PROC_ENTRY Removing dead SERIAL_BFIN_{HARD_,}CTSRTS Removing dead SERIAL_BFIN_SPORT_CTSRTS Removing dead SERIAL_BFIN_SPORT_CONSOLE
drivers/serial/68328serial.c | 16 ++---- drivers/serial/68328serial.h | 5 -- drivers/serial/68360serial.c | 26 +--------- drivers/serial/bfin_5xx.c | 103 -------------------------------------- drivers/serial/bfin_sport_uart.c | 100 ++----------------------------------- drivers/serial/crisv10.c | 71 -------------------------- 6 files changed, 12 insertions(+), 309 deletions(-)
PATCH 1/11 Removing dead 68328_SERIAL_UART
68328_SERIAL_UART doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/68328serial.h | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/serial/68328serial.h +0 -5
@@ -181,13 +181,8 @@ struct m68k_serial {/* * Define the number of ports supported and their irqs. */ -#ifndef CONFIG_68328_SERIAL_UART2 -#define NR_PORTS 1 -#define UART_IRQ_DEFNS {UART_IRQ_NUM} -#else #define NR_PORTS 2#define UART_IRQ_DEFNS {UART1_IRQ_NUM, UART2_IRQ_NUM} -#endif #endif /* __KERNEL__ */ #endif /* !(_MC683XX_SERIAL_H) */
Signature · 1 line
1.7.0.4
PATCH 2/11 Removing dead CONSOLE_*
In reply to Christoph EggerCONSOLE_* doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/68360serial.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-)
drivers/serial/68360serial.c +2 -10
@@ -303,16 +303,8 @@ static int baud_table[] = { 9600, 19200, 38400, 57600, 115200, 230400, 460800, 0 };/* This sucks. There is a better way: */ -#if defined(CONFIG_CONSOLE_9600 ) -#define CONSOLE_BAUDRATE 9600 -#elif defined(CONFIG_CONSOLE_19200 ) -#define CONSOLE_BAUDRATE 19200 -#elif defined(CONFIG_CONSOLE_115200 ) -#define CONSOLE_BAUDRATE 115200 -#else -#warning "console baud rate undefined" -#define CONSOLE_BAUDRATE 9600 -#endif +#warning "console baud rate undefined" +#define CONSOLE_BAUDRATE 9600/* * ------------------------------------------------------------
Signature · 1 line
1.7.0.4
PATCH 3/11 Removing dead PP04
In reply to Christoph EggerPP04 doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/68360serial.c | 14 -------------- 1 files changed, 0 insertions(+), 14 deletions(-)
drivers/serial/68360serial.c +0 -14
@@ -2495,20 +2495,6 @@ static int __init rs_360_init(void) cp->si_sicr &= ~0x00ffff00 ; cp->si_sicr |=0x001b1200 ; -#ifdef CONFIG_PP04 -/* Frequentis PP04 forced to RS-232 until we know better. -* Port C 12 and 13 low enables RS-232 on SCC3 and SCC4. -*/ - immap->im_ioport.iop_pcdir |=0x000c ; - immap->im_ioport.iop_pcpar &= ~0x000c ; - immap->im_ioport.iop_pcdat &= ~0x000c ; - -/* This enables the TX driver. -*/ - cp->cp_pbpar &= ~0x6000 ; - cp->cp_pbdat &= ~0x6000 ; -#endif -for (i =0 , state = rs_table; i <NR_PORTS ; i++,state++) { state->magic =SSTATE_MAGIC ; state->line = i;
Signature · 1 line
1.7.0.4
PATCH 4/11 Removing dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS)
In reply to Christoph Egger(ALMA_ANS | DRAGONIXVZ | M68EZ328ADS) doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/68328serial.c | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-)
drivers/serial/68328serial.c +5 -11
@@ -102,19 +102,13 @@ static void change_speed(struct m68k_serial *info);* Setup for console. Argument comes from the boot command line. */ -#if defined(CONFIG_M68EZ328ADS ) || defined(CONFIG_ALMA_ANS ) || defined(CONFIG_DRAGONIXVZ ) -#define CONSOLE_BAUD_RATE 115200 -#define DEFAULT_CBAUD B115200 -#else -/* (es) */ -/* note: this is messy, but it works, again, perhaps defined somewhere else?*/ -#ifdef CONFIG_M68VZ328 -#define CONSOLE_BAUD_RATE 19200 -#define DEFAULT_CBAUD B19200 -#endif -/* (/es) */ +/* note: this is messy, but it works, again, perhaps defined somewhere else?*/ +#ifdef CONFIG_M68VZ328 +#define CONSOLE_BAUD_RATE 19200 +#define DEFAULT_CBAUD B19200#endif +#ifndef CONSOLE_BAUD_RATE #define CONSOLE_BAUD_RATE 9600#define DEFAULT_CBAUD B9600
Signature · 1 line
1.7.0.4
Re: [PATCH 04/11] Removing dead (ALMA_ANS | DRAGONIXVZ | M68EZ328ADS)
Quoted 4 lines · Christoph Egger
(
ALMA_ANS| DRAGONIXVZ | M68EZ328ADS) doesn't exist inKconfig, therefore removing all references for it from the source code.Signed-off-by Christoph Egger <[email protected]>
Quoted 32 lines
drivers/serial/68328serial.c | 16 +++++----------- 1 files changed, 5 insertions(+), 11 deletions(-)drivers/serial/68328serial.c +5
-11@@ -102,19 +102,13 @@ static void change_speed(struct m68k_serial *info);* Setup for console. Argument comes from the boot command line. */ -#if defined(CONFIG_M68EZ328ADS ) || defined(CONFIG_ALMA_ANS ) || defined(CONFIG_DRAGONIXVZ ) -#define CONSOLE_BAUD_RATE 115200 -#define DEFAULT_CBAUD B115200 -#else -/* (es) */ -/* note: this is messy, but it works, again, perhaps defined somewhere else?*/ -#ifdef CONFIG_M68VZ328 -#define CONSOLE_BAUD_RATE 19200 -#define DEFAULT_CBAUD B19200 -#endif -/* (/es) */ +/* note: this is messy, but it works, again, perhaps defined somewhere else?*/ +#ifdef CONFIG_M68VZ328 +#define CONSOLE_BAUD_RATE 19200 +#define DEFAULT_CBAUD B19200#endif +#ifndef CONSOLE_BAUD_RATE #define CONSOLE_BAUD_RATE 9600#define DEFAULT_CBAUD B9600
Signature · 5 lines
------------------------------------------------------------------------ Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com
PATCH 5/11 Removing dead ETRAX_RS485_ON_PORT_G
In reply to Christoph EggerETRAX_RS485_ON_PORT_G doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/crisv10.c | 24 ------------------------ 1 files changed, 0 insertions(+), 24 deletions(-)
drivers/serial/crisv10.c +0 -24
@@ -57,10 +57,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
@@ -495,9 +491,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. */
@@ -1400,10 +1393,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 );
@@ -3871,10 +3860,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 );
@@ -4443,15 +4428,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_ser0,'g' , rs485_pa_bit, - rs485_port_g_bit)) { -printk (KERN_CRIT "ETRAX100LX serial: Could not allocate " -"RS485 pin\n" ); -put_tty_driver (driver); -return -EBUSY ; - } -#endif #endif /* Initialize the tty_driver structure */
Signature · 1 line
1.7.0.4
PATCH 6/11 Removing dead ETRAX_RS485_LTC1387
In reply to Christoph EggerETRAX_RS485_LTC1387 doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/crisv10.c | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
drivers/serial/crisv10.c +0 -12
@@ -1393,12 +1393,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_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.flags = r->flags;if (r->delay_rts_before_send >=1000 )
@@ -3860,12 +3854,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_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
Signature · 1 line
1.7.0.4
PATCH 7/11 Removing dead ETRAX_EXTERN_PB6CLK_ENABLED
In reply to Christoph EggerETRAX_EXTERN_PB6CLK_ENABLED doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/crisv10.c | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
drivers/serial/crisv10.c +0 -13
@@ -2981,19 +2981,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
1.7.0.4
PATCH 8/11 Removing dead ETRAX_SERIAL_PROC_ENTRY
In reply to Christoph EggerETRAX_SERIAL_PROC_ENTRY doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/crisv10.c | 22 ---------------------- 1 files changed, 0 insertions(+), 22 deletions(-)
drivers/serial/crisv10.c +0 -22
@@ -459,30 +459,8 @@ 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
Signature · 1 line
1.7.0.4
PATCH 9/11 Removing dead SERIAL_BFIN_{HARD_,}CTSRTS
In reply to Christoph EggerSERIAL_BFIN_{HARD_,}CTSRTS doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/bfin_5xx.c | 103 --------------------------------------------- 1 files changed, 0 insertions(+), 103 deletions(-)
drivers/serial/bfin_5xx.c +0 -103
@@ -82,53 +82,6 @@ static void bfin_serial_tx_chars(struct bfin_serial_port *uart);static void bfin_serial_reset_irda (struct uart_port *port); -#if defined(CONFIG_SERIAL_BFIN_CTSRTS ) || \ - defined(CONFIG_SERIAL_BFIN_HARD_CTSRTS ) -static unsigned int bfin_serial_get_mctrl (struct uart_port *port) -{ -struct bfin_serial_port *uart = (struct bfin_serial_port *)port; -if (uart->cts_pin <0 ) -return TIOCM_CTS |TIOCM_DSR |TIOCM_CAR ; - -/* CTS PIN is negative assertive. */ -if (UART_GET_CTS (uart)) -return TIOCM_CTS |TIOCM_DSR |TIOCM_CAR ; -else -return TIOCM_DSR |TIOCM_CAR ; -} - -static void bfin_serial_set_mctrl (struct uart_port *port,unsigned int mctrl) -{ -struct bfin_serial_port *uart = (struct bfin_serial_port *)port; -if (uart->rts_pin <0 ) -return ; - -/* RTS PIN is negative assertive. */ -if (mctrl &TIOCM_RTS ) -UART_ENABLE_RTS (uart); -else -UART_DISABLE_RTS (uart); -} - -/* -* Handle any change of modem status signal. -*/ -static irqreturn_t bfin_serial_mctrl_cts_int (int irq,void *dev_id) -{ -struct bfin_serial_port *uart = dev_id; -unsigned int status; - - status =bfin_serial_get_mctrl (&uart->port); -uart_handle_cts_change (&uart->port, status &TIOCM_CTS ); -#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS - uart->scts =1 ; -UART_CLEAR_SCTS (uart); -UART_CLEAR_IER (uart,EDSSI ); -#endif - -return IRQ_HANDLED ; -} -#else static unsigned int bfin_serial_get_mctrl (struct uart_port *port) {return TIOCM_CTS |TIOCM_DSR |TIOCM_CAR ;
@@ -137,7 +90,6 @@ static unsigned int bfin_serial_get_mctrl(struct uart_port *port)static void bfin_serial_set_mctrl (struct uart_port *port,unsigned int mctrl) { } -#endif /* * interrupts are disabled on entry
@@ -727,35 +679,6 @@ static int bfin_serial_startup(struct uart_port *port)# endif #endif -#ifdef CONFIG_SERIAL_BFIN_CTSRTS -if (uart->cts_pin >=0 ) { -if (request_irq (gpio_to_irq (uart->cts_pin), - bfin_serial_mctrl_cts_int, -IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING | -IRQF_DISABLED ,"BFIN_UART_CTS" , uart)) { - uart->cts_pin =-1 ; -pr_info ("Unable to attach BlackFin UART CTS interrupt.\ -So, disable it.\n" ); - } - } -if (uart->rts_pin >=0 ) { -gpio_request (uart->rts_pin,DRIVER_NAME ); -gpio_direction_output (uart->rts_pin,0 ); - } -#endif -#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS -if (request_irq (uart->status_irq, - bfin_serial_mctrl_cts_int, -IRQF_DISABLED ,"BFIN_UART_MODEM_STATUS" , uart)) { -pr_info ("Unable to attach BlackFin UART Modem \ -Status interrupt.\n" ); - } - -/* CTS RTS PINs are negative assertive. */ -UART_PUT_MCR (uart,ACTS ); -UART_SET_IER (uart,EDSSI ); -#endif -UART_SET_IER (uart,ERBFI );return 0 ; }
@@ -790,16 +713,6 @@ static void bfin_serial_shutdown(struct uart_port *port)free_irq (uart->port.irq+1 , uart);#endif -#ifdef CONFIG_SERIAL_BFIN_CTSRTS -if (uart->cts_pin >=0 ) -free_irq (gpio_to_irq (uart->cts_pin), uart); -if (uart->rts_pin >=0 ) -gpio_free (uart->rts_pin); -#endif -#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS -if (UART_GET_IER (uart) &&EDSSI ) -free_irq (uart->status_irq, uart); -#endif } static void
@@ -1134,13 +1047,6 @@ static void __init bfin_serial_init_ports(void) bfin_serial_resource[i].uart_rx_dma_channel;init_timer (&(bfin_serial_ports[i].rx_dma_timer));#endif -#if defined(CONFIG_SERIAL_BFIN_CTSRTS ) || \ - defined(CONFIG_SERIAL_BFIN_HARD_CTSRTS ) - bfin_serial_ports[i].cts_pin = - bfin_serial_resource[i].uart_cts_pin; - bfin_serial_ports[i].rts_pin = - bfin_serial_resource[i].uart_rts_pin; -#endif } }
@@ -1198,12 +1104,7 @@ bfin_serial_console_setup(struct console *co, char *options)int baud =57600 ;int bits =8 ;int parity ='n' ; -# if defined(CONFIG_SERIAL_BFIN_CTSRTS ) || \ - defined(CONFIG_SERIAL_BFIN_HARD_CTSRTS ) -int flow ='r' ; -# else int flow ='n' ; -# endif /* * Check whether an invalid uart number has been specified, and
@@ -1401,10 +1302,6 @@ static int bfin_serial_remove(struct platform_device *dev)continue ;uart_remove_one_port (&bfin_serial_reg, &bfin_serial_ports[i].port); bfin_serial_ports[i].port.dev =NULL ; -#if defined(CONFIG_SERIAL_BFIN_CTSRTS ) -gpio_free (bfin_serial_ports[i].cts_pin); -gpio_free (bfin_serial_ports[i].rts_pin); -#endif }return 0 ;
Signature · 1 line
1.7.0.4
RE: [Uclinux-dist-devel] [PATCH 09/11] Removing dead SERIAL_BFIN_{HARD_, }CTSRTS
Christoph Egger wrote on 2010-07-09:
Quoted 2 lines
SERIAL_BFIN_{HARD_,}CTSRTS doesn't exist in
Kconfig, therefore removing all references for it from the source code.
Right it doesn't exist in Kconfig - however it gets defined in bfin_serial.h.
#if defined(CONFIG_BFIN_UART0_CTSRTS) || \
defined(CONFIG_BFIN_UART1_CTSRTS) || \
defined(CONFIG_BFIN_UART2_CTSRTS) || \
defined(CONFIG_BFIN_UART3_CTSRTS)
# ifdef BFIN_UART_BF54X_STYLE
# define CONFIG_SERIAL_BFIN_HARD_CTSRTS
# else
# define CONFIG_SERIAL_BFIN_CTSRTS
# endif
#endifI guess we shouldn't prefix those defines with CONFIG_
Greetings,
Michael
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 4036 Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
PATCH 10/11 Removing dead SERIAL_BFIN_SPORT_CTSRTS
In reply to Christoph EggerSERIAL_BFIN_SPORT_CTSRTS doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/bfin_sport_uart.c | 85 -------------------------------------- 1 files changed, 0 insertions(+), 85 deletions(-)
drivers/serial/bfin_sport_uart.c +0 -85
@@ -49,10 +49,6 @@ struct sport_uart_port {unsigned short txmask2;unsigned char stopb;/* unsigned char parib; */ -#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS -int cts_pin; -int rts_pin; -#endif };static int sport_uart_tx_chars (struct sport_uart_port *up);
@@ -203,47 +199,6 @@ static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)return IRQ_HANDLED ; } -#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS -static unsigned int sport_get_mctrl (struct uart_port *port) -{ -struct sport_uart_port *up = (struct sport_uart_port *)port; -if (up->cts_pin <0 ) -return TIOCM_CTS |TIOCM_DSR |TIOCM_CAR ; - -/* CTS PIN is negative assertive. */ -if (SPORT_UART_GET_CTS (up)) -return TIOCM_CTS |TIOCM_DSR |TIOCM_CAR ; -else -return TIOCM_DSR |TIOCM_CAR ; -} - -static void sport_set_mctrl (struct uart_port *port,unsigned int mctrl) -{ -struct sport_uart_port *up = (struct sport_uart_port *)port; -if (up->rts_pin <0 ) -return ; - -/* RTS PIN is negative assertive. */ -if (mctrl &TIOCM_RTS ) -SPORT_UART_ENABLE_RTS (up); -else -SPORT_UART_DISABLE_RTS (up); -} - -/* -* Handle any change of modem status signal. -*/ -static irqreturn_t sport_mctrl_cts_int (int irq,void *dev_id) -{ -struct sport_uart_port *up = (struct sport_uart_port *)dev_id; -unsigned int status; - - status =sport_get_mctrl (&up->port); -uart_handle_cts_change (&up->port, status &TIOCM_CTS ); - -return IRQ_HANDLED ; -} -#else static unsigned int sport_get_mctrl (struct uart_port *port) {pr_debug ("%s enter\n" , __func__);
@@ -254,7 +209,6 @@ static void sport_set_mctrl(struct uart_port *port, unsigned int mctrl) {pr_debug ("%s enter\n" , __func__); } -#endif /* Reqeust IRQ, Setup clock */ static int sport_startup (struct uart_port *port)
@@ -284,21 +238,6 @@ static int sport_startup(struct uart_port *port) goto fail2; } -#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS -if (up->cts_pin >=0 ) { -if (request_irq (gpio_to_irq (up->cts_pin), - sport_mctrl_cts_int, -IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING | -IRQF_DISABLED ,"BFIN_SPORT_UART_CTS" , up)) { - up->cts_pin =-1 ; -dev_info (port->dev,"Unable to attach BlackFin UART \ -over SPORT CTS interrupt. So, disable it.\n" ); - } - } -if (up->rts_pin >=0 ) -gpio_direction_output (up->rts_pin,0 ); -#endif -return 0 ; fail2:free_irq (up->port.irq+1 , up);
@@ -438,10 +377,6 @@ static void sport_shutdown(struct uart_port *port)free_irq (up->port.irq, up);free_irq (up->port.irq+1 , up);free_irq (up->err_irq, up); -#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS -if (up->cts_pin >=0 ) -free_irq (gpio_to_irq (up->cts_pin), up); -#endif }static const char *sport_type (struct uart_port *port)
@@ -599,11 +534,7 @@ sport_uart_console_setup(struct console *co, char *options)int baud =57600 ;int bits =8 ;int parity ='n' ; -# ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS -int flow ='r' ; -# else int flow ='n' ; -# endif /* Check whether an invalid uart number has been specified */ if (co->index <0 || co->index >=BFIN_SPORT_UART_MAX_PORTS )
@@ -795,22 +726,6 @@ static int __devinit sport_uart_probe(struct platform_device *pdev) ret = -ENOENT ; goto out_error_unmap; } -#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS - res =platform_get_resource (pdev,IORESOURCE_IO ,0 ); -if (res ==NULL ) - sport->cts_pin =-1 ; -else - sport->cts_pin = res->start; - - res =platform_get_resource (pdev,IORESOURCE_IO ,1 ); -if (res ==NULL ) - sport->rts_pin =-1 ; -else - sport->rts_pin = res->start; - -if (sport->rts_pin >=0 ) -gpio_request (sport->rts_pin,DRV_NAME ); -#endif }#ifdef CONFIG_SERIAL_BFIN_SPORT_CONSOLE
Signature · 1 line
1.7.0.4
Mike Frysinger
NAKRe: [PATCH 10/11] Removing dead SERIAL_BFIN_SPORT_CTSRTS
Quoted 2 lines · Christoph Egger
SERIAL_BFIN_SPORT_CTSRTSdoesn't exist inKconfig, therefore removing all references for it from the source code.
NAK: it is defied & used locally
-mike
PATCH 11/11 Removing dead SERIAL_BFIN_SPORT_CONSOLE
In reply to Christoph EggerSERIAL_BFIN_SPORT_CONSOLE doesn't exist in Kconfig, therefore removing all references for it from the source code.
--- drivers/serial/bfin_sport_uart.c | 15 +++++---------- 1 files changed, 5 insertions(+), 10 deletions(-)
drivers/serial/bfin_sport_uart.c +5 -10
@@ -728,16 +728,11 @@ static int __devinit sport_uart_probe(struct platform_device *pdev) } } -#ifdef CONFIG_SERIAL_BFIN_SPORT_CONSOLE -if (!is_early_platform_device (pdev)) { -#endif - sport = bfin_sport_uart_ports[pdev->id]; - sport->port.dev = &pdev->dev; -dev_set_drvdata (&pdev->dev, sport); - ret =uart_add_one_port (&sport_uart_reg, &sport->port); -#ifdef CONFIG_SERIAL_BFIN_SPORT_CONSOLE - } -#endif + sport = bfin_sport_uart_ports[pdev->id]; + sport->port.dev = &pdev->dev; +dev_set_drvdata (&pdev->dev, sport); + ret =uart_add_one_port (&sport_uart_reg, &sport->port); +if (!ret)return 0 ;
Signature · 1 line
1.7.0.4
Mike Frysinger
NAKRe: [PATCH 11/11] Removing dead SERIAL_BFIN_SPORT_CONSOLE
Quoted 2 lines · Christoph Egger
SERIAL_BFIN_SPORT_CONSOLEdoesn't exist inKconfig, therefore removing all references for it from the source code.
NAK
your source is outdated then:
./Kconfig:config SERIAL_BFIN_SPORT_CONSOLE
-mike