[PATCH 17/54] powerpc/shared/console: Fix warnings

Joel Sherrill joel.sherrill at oarcorp.com
Mon Oct 13 15:37:01 UTC 2014


---
 c/src/lib/libbsp/powerpc/shared/console/console.c |  4 +++
 c/src/lib/libbsp/powerpc/shared/console/uart.c    | 35 +++++++----------------
 2 files changed, 15 insertions(+), 24 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/shared/console/console.c b/c/src/lib/libbsp/powerpc/shared/console/console.c
index 59b0804..b68e076 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/console.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/console.c
@@ -148,6 +148,7 @@ rtems_device_driver console_initialize(
   return RTEMS_SUCCESSFUL;
 } /* console_initialize */
 
+#if !defined(USE_POLLED_IO)
 static int console_first_open(int major, int minor, void *arg)
 {
   rtems_status_code status;
@@ -174,12 +175,15 @@ static int console_first_open(int major, int minor, void *arg)
 
   return 0;
 }
+#endif
 
+#if !defined(USE_POLLED_IO)
 static int console_last_close(int major, int minor, void *arg)
 {
   BSP_uart_remove_isr(minor, ttyS[minor].isr);
   return 0;
 }
+#endif
 
 /*-------------------------------------------------------------------------+
 | Console device driver OPEN entry point
diff --git a/c/src/lib/libbsp/powerpc/shared/console/uart.c b/c/src/lib/libbsp/powerpc/shared/console/uart.c
index 67816e3..917fd5b 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/uart.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/uart.c
@@ -82,8 +82,7 @@ uwrite(int uart, int reg, unsigned int val)
 }
 
 
-#ifdef UARTDEBUG
-    static void
+static void
 uartError(int uart, void *termiosPrivate)
 {
   unsigned char uartStatus, dummy;
@@ -92,6 +91,7 @@ uartError(int uart, void *termiosPrivate)
   uartStatus = uread(uart, LSR);
   dummy = uread(uart, RBR);
 
+#ifdef UARTDEBUG
   if (uartStatus & OE)
     printk("********* Over run Error **********\n");
   if (uartStatus & PE)
@@ -100,32 +100,18 @@ uartError(int uart, void *termiosPrivate)
     printk("********* Framing Error  **********\n");
   if (uartStatus & BI) {
     printk("********* BREAK INTERRUPT *********\n");
-	if ((h=uart_data[uart].breakCallback.handler))
-		h(uart,
-		  (dummy<<8)|uartStatus,
-		  termiosPrivate,
-		  uart_data[uart].breakCallback.private);
-
+#endif
+   if ((h=uart_data[uart].breakCallback.handler)) {
+     h(uart,
+       (dummy<<8)|uartStatus,
+       termiosPrivate,
+       uart_data[uart].breakCallback.private);
   }
+#ifdef UARTDEBUG
   if (uartStatus & ERFIFO)
     printk("********* Error receive Fifo **********\n");
-
-}
-#else
-inline void uartError(int uart, void *termiosPrivate)
-{
-  unsigned char uartStatus,dummy;
-  BSP_UartBreakCbProc		h;
-
-  uartStatus = uread(uart, LSR);
-  dummy		 = uread(uart, RBR);
-  if ((uartStatus & BI) && (h=uart_data[uart].breakCallback.handler))
-		h(uart,
-		  (dummy<<8)|uartStatus,
-		  termiosPrivate,
-		  uart_data[uart].breakCallback.private);
-}
 #endif
+}
 
 /*
  * Uart initialization, it is hardcoded to 8 bit, no parity,
@@ -197,6 +183,7 @@ BSP_uart_init(int uart, int baud, int hwFlow)
   tmp = uread(uart, LSR);
   tmp = uread(uart, RBR);
   tmp = uread(uart, MSR);
+  (void) tmp; /* avoid set but not used warning */
 
   /* Remember state */
   uart_data[uart].hwFlow     = hwFlow;
-- 
1.9.3




More information about the devel mailing list