2008-09-25 10:12:52 bfin_5xx.c file doesn't compile after commit 5335 in kernel branch 2008R1
Andrea Federico Grisotto (ITALY)
Message: 62710
After your last commit in linux kernel branch 2008R1 (revision 5335)
bfin_5xx.c file doesn't compile.
This is a patch.
===================================================================
--- bfin_5xx.c (revision 5337)
+++ bfin_5xx.c (working copy)
@@ -95,7 +95,6 @@
static void bfin_serial_start_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
- int flags;
#ifdef CONFIG_SERIAL_BFIN_DMA
if (uart->tx_done)
@@ -140,12 +139,12 @@
void kgdb_put_debug_char(int chr)
{
struct bfin_serial_port *uart;
-
+
if (CONFIG_KGDB_UART_PORT<0 || CONFIG_KGDB_UART_PORT>=NR_PORTS)
uart = &bfin_serial_ports[0];
else
uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
-
+
while (!(UART_GET_LSR(uart) & THRE)) {
SSYNC();
}
@@ -167,7 +166,7 @@
uart = &bfin_serial_ports[0];
else
uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
-
+
while(!(UART_GET_LSR(uart) & DR)) {
SSYNC();
}
@@ -382,12 +381,15 @@
}
#endif
- spin_lock_irqsave(&uart->port.lock, flags);
#ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
{
- struct circ_buf *xmit = &uart->port.info->xmit;
+ struct circ_buf *xmit;
+ int flags;
+ spin_lock_irqsave(&uart->port.lock, flags);
+ xmit = &uart->port.info->xmit;
+
uart->tx_done = 0;
/*
===================================================================
QuoteReplyEditDelete
2008-09-25 10:37:14 Re: bfin_5xx.c file doesn't compile after commit 5335 in kernel branch 2008R1
Robin Getz (UNITED STATES)
Message: 62711
Andrea:
Thanks. I get the same thing.
CC drivers/serial/bfin_5xx.o
drivers/serial/bfin_5xx.c: In function ‘bfin_serial_start_tx’:
drivers/serial/bfin_5xx.c:98: warning: unused variable ‘flags’
drivers/serial/bfin_5xx.c: At top level:
drivers/serial/bfin_5xx.c:385: error: expected identifier or ‘(’ before ‘do’
drivers/serial/bfin_5xx.c:385: error: expected identifier or ‘(’ before ‘while’
drivers/serial/bfin_5xx.c: In function ‘bfin_serial_dma_tx_chars’:
drivers/serial/bfin_5xx.c:432: error: ‘flags’ undeclared (first use in this function)
drivers/serial/bfin_5xx.c:432: error: (Each undeclared identifier is reported only once
drivers/serial/bfin_5xx.c:432: error: for each function it appears in.)
make[2]: *** [drivers/serial/bfin_5xx.o] Error 1
QuoteReplyEditDelete
2008-09-25 10:41:22 Re: bfin_5xx.c file doesn't compile after commit 5335 in kernel branch 2008R1
Andrea Federico Grisotto (ITALY)
Message: 62713
I correct my last patch because in 'bfin_serial_dma_tx_chars' function there is
a point where the function can return and is necessary to call 'spin_unlock_irqrestore'
===================================================================
--- bfin_5xx.c (revision 5337)
+++ bfin_5xx.c (working copy)
@@ -95,7 +95,6 @@
static void bfin_serial_start_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
- int flags;
#ifdef CONFIG_SERIAL_BFIN_DMA
if (uart->tx_done)
@@ -140,12 +139,12 @@
void kgdb_put_debug_char(int chr)
{
struct bfin_serial_port *uart;
-
+
if (CONFIG_KGDB_UART_PORT<0 || CONFIG_KGDB_UART_PORT>=NR_PORTS)
uart = &bfin_serial_ports[0];
else
uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
-
+
while (!(UART_GET_LSR(uart) & THRE)) {
SSYNC();
}
@@ -167,7 +166,7 @@
uart = &bfin_serial_ports[0];
else
uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT];
-
+
while(!(UART_GET_LSR(uart) & DR)) {
SSYNC();
}
@@ -382,12 +381,15 @@
}
#endif
- spin_lock_irqsave(&uart->port.lock, flags);
#ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
{
- struct circ_buf *xmit = &uart->port.info->xmit;
+ struct circ_buf *xmit;
+ int flags;
+ spin_lock_irqsave(&uart->port.lock, flags);
+ xmit = &uart->port.info->xmit;
+
uart->tx_done = 0;
/*
@@ -399,6 +401,7 @@
if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) {
uart->tx_count = 0;
uart->tx_done = 1;
+ spin_unlock_irqrestore(&uart->port.lock, flags);
return;
}
===================================================================