Commit a62c4133 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

drivers/serial: use nr_irqs

Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 171ac6ae
...@@ -2486,7 +2486,7 @@ static void serial8250_config_port(struct uart_port *port, int flags) ...@@ -2486,7 +2486,7 @@ static void serial8250_config_port(struct uart_port *port, int flags)
static int static int
serial8250_verify_port(struct uart_port *port, struct serial_struct *ser) serial8250_verify_port(struct uart_port *port, struct serial_struct *ser)
{ {
if (ser->irq >= NR_IRQS || ser->irq < 0 || if (ser->irq >= nr_irqs || ser->irq < 0 ||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN || ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
ser->type >= ARRAY_SIZE(uart_config) || ser->type == PORT_CIRRUS || ser->type >= ARRAY_SIZE(uart_config) || ser->type == PORT_CIRRUS ||
ser->type == PORT_STARTECH) ser->type == PORT_STARTECH)
......
...@@ -512,7 +512,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser) ...@@ -512,7 +512,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
int ret = 0; int ret = 0;
if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA) if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA)
ret = -EINVAL; ret = -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS) if (ser->irq < 0 || ser->irq >= nr_irqs)
ret = -EINVAL; ret = -EINVAL;
if (ser->baud_base < 9600) if (ser->baud_base < 9600)
ret = -EINVAL; ret = -EINVAL;
......
...@@ -572,7 +572,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser) ...@@ -572,7 +572,7 @@ static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
int ret = 0; int ret = 0;
if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA) if (ser->type != PORT_UNKNOWN && ser->type != PORT_AMBA)
ret = -EINVAL; ret = -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS) if (ser->irq < 0 || ser->irq >= nr_irqs)
ret = -EINVAL; ret = -EINVAL;
if (ser->baud_base < 9600) if (ser->baud_base < 9600)
ret = -EINVAL; ret = -EINVAL;
......
...@@ -623,7 +623,7 @@ static int cpm_uart_verify_port(struct uart_port *port, ...@@ -623,7 +623,7 @@ static int cpm_uart_verify_port(struct uart_port *port,
if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM) if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
ret = -EINVAL; ret = -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS) if (ser->irq < 0 || ser->irq >= nr_irqs)
ret = -EINVAL; ret = -EINVAL;
if (ser->baud_base < 9600) if (ser->baud_base < 9600)
ret = -EINVAL; ret = -EINVAL;
......
...@@ -922,7 +922,7 @@ static void m32r_sio_config_port(struct uart_port *port, int flags) ...@@ -922,7 +922,7 @@ static void m32r_sio_config_port(struct uart_port *port, int flags)
static int static int
m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser) m32r_sio_verify_port(struct uart_port *port, struct serial_struct *ser)
{ {
if (ser->irq >= NR_IRQS || ser->irq < 0 || if (ser->irq >= nr_irqs || ser->irq < 0 ||
ser->baud_base < 9600 || ser->type < PORT_UNKNOWN || ser->baud_base < 9600 || ser->type < PORT_UNKNOWN ||
ser->type >= ARRAY_SIZE(uart_config)) ser->type >= ARRAY_SIZE(uart_config))
return -EINVAL; return -EINVAL;
...@@ -1162,7 +1162,7 @@ static int __init m32r_sio_init(void) ...@@ -1162,7 +1162,7 @@ static int __init m32r_sio_init(void)
printk(KERN_INFO "Serial: M32R SIO driver\n"); printk(KERN_INFO "Serial: M32R SIO driver\n");
for (i = 0; i < NR_IRQS; i++) for (i = 0; i < nr_irqs; i++)
spin_lock_init(&irq_lists[i].lock); spin_lock_init(&irq_lists[i].lock);
ret = uart_register_driver(&m32r_sio_reg); ret = uart_register_driver(&m32r_sio_reg);
......
...@@ -741,7 +741,7 @@ static int uart_set_info(struct uart_state *state, ...@@ -741,7 +741,7 @@ static int uart_set_info(struct uart_state *state,
if (port->ops->verify_port) if (port->ops->verify_port)
retval = port->ops->verify_port(port, &new_serial); retval = port->ops->verify_port(port, &new_serial);
if ((new_serial.irq >= NR_IRQS) || (new_serial.irq < 0) || if ((new_serial.irq >= nr_irqs) || (new_serial.irq < 0) ||
(new_serial.baud_base < 9600)) (new_serial.baud_base < 9600))
retval = -EINVAL; retval = -EINVAL;
......
...@@ -460,7 +460,7 @@ static int lh7a40xuart_verify_port (struct uart_port* port, ...@@ -460,7 +460,7 @@ static int lh7a40xuart_verify_port (struct uart_port* port,
if (ser->type != PORT_UNKNOWN && ser->type != PORT_LH7A40X) if (ser->type != PORT_UNKNOWN && ser->type != PORT_LH7A40X)
ret = -EINVAL; ret = -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS) if (ser->irq < 0 || ser->irq >= nr_irqs)
ret = -EINVAL; ret = -EINVAL;
if (ser->baud_base < 9600) /* *** FIXME: is this true? */ if (ser->baud_base < 9600) /* *** FIXME: is this true? */
ret = -EINVAL; ret = -EINVAL;
......
...@@ -1157,7 +1157,7 @@ static int sci_verify_port(struct uart_port *port, struct serial_struct *ser) ...@@ -1157,7 +1157,7 @@ static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
{ {
struct sci_port *s = &sci_ports[port->line]; struct sci_port *s = &sci_ports[port->line];
if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > NR_IRQS) if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > nr_irqs)
return -EINVAL; return -EINVAL;
if (ser->baud_base < 2400) if (ser->baud_base < 2400)
/* No paper tape reader for Mitch.. */ /* No paper tape reader for Mitch.. */
......
...@@ -1066,7 +1066,7 @@ static int qe_uart_verify_port(struct uart_port *port, ...@@ -1066,7 +1066,7 @@ static int qe_uart_verify_port(struct uart_port *port,
if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM) if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
return -EINVAL; return -EINVAL;
if (ser->irq < 0 || ser->irq >= NR_IRQS) if (ser->irq < 0 || ser->irq >= nr_irqs)
return -EINVAL; return -EINVAL;
if (ser->baud_base < 9600) if (ser->baud_base < 9600)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment