[PATCH 27/54] libcpu/powerpc/ppc403: Fix warnings

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


---
 c/src/lib/libcpu/powerpc/ppc403/clock/clock.c      | 31 +---------------------
 .../lib/libcpu/powerpc/ppc403/console/console405.c |  3 +--
 c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c  | 18 ++++++++-----
 3 files changed, 13 insertions(+), 39 deletions(-)

diff --git a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
index da05ccb..6ae72a2 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/clock/clock.c
@@ -228,7 +228,7 @@ static void ClockOn(const rtems_irq_connect_data* unused)
 #endif
 }
 
-void Install_clock(void (*clock_isr)(void *))
+static void Install_clock(void (*clock_isr)(void *))
 {
   rtems_irq_connect_data clockIrqConnData;
 
@@ -254,35 +254,6 @@ void Install_clock(void (*clock_isr)(void *))
   atexit(Clock_exit);
 }
 
-void ReInstall_clock(void (*new_clock_isr)(void *))
-{
-  uint32_t               isrlevel = 0;
-  rtems_irq_connect_data clockIrqConnData;
-
-  rtems_interrupt_disable(isrlevel);
-
-  clockIrqConnData.name = BSP_PIT;
-  if (!BSP_get_current_rtems_irq_handler(&clockIrqConnData)) {
-    printk("Unable to stop system clock\n");
-    rtems_fatal_error_occurred(1);
-  }
-
-  BSP_remove_rtems_irq_handler (&clockIrqConnData);
-
-  clockIrqConnData.on   = ClockOn;
-  clockIrqConnData.off  = ClockOff;
-  clockIrqConnData.isOn = ClockIsOn;
-  clockIrqConnData.name = BSP_PIT;
-  clockIrqConnData.hdl  = new_clock_isr;
-
-  if (!BSP_install_rtems_irq_handler (&clockIrqConnData)) {
-    printk("Unable to connect Clock Irq handler\n");
-    rtems_fatal_error_occurred(1);
-  }
-
-  rtems_interrupt_enable(isrlevel);
-}
-
 /*
  * Called via atexit()
  * Remove the clock interrupt handler by setting handler to NULL
diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c
index 206d209..ac7a66d 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c
@@ -56,8 +56,7 @@
 #include <rtems/libio.h>
 #include "../irq/ictrl.h"
 #include <stdlib.h>                                     /* for atexit() */
-
-
+#include <rtems/console.h>
 
 struct async {
 /*---------------------------------------------------------------------------+
diff --git a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
index 0733ddb..1d7b013 100644
--- a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
+++ b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
@@ -17,6 +17,7 @@
 #include <rtems/libio.h>
 #include "../irq/ictrl.h"
 #include <stdlib.h>                                     /* for atexit() */
+#include <tty_drv.h>
 
 extern uint32_t bsp_serial_per_sec;
 extern bool bsp_serial_external_clock;
@@ -149,13 +150,14 @@ static const tty0pasync tty0port = (tty0pasync)(0xEF600300   + (TTY0_USE_UART*0x
 static void *tty0ttyp;         /* handle for termios */
 
 
-int tty0_round(double x)
+static int
+tty0_round(double x)
 {
   return (int)((int)((x-(int)x)*1000)>500 ? x+1 : x);
 }
 
-void
-tty0BaudSet(uint32_t   baudrate)
+static void
+tty0BaudSet(uint32_t baudrate)
 {
   uint32_t   tmp;
 
@@ -168,6 +170,7 @@ tty0BaudSet(uint32_t   baudrate)
 
   tty0port->LCR = tty0port->LCR & ~LCR_DL;
 }
+
 /*
  * Hardware-dependent portion of tcsetattr().
  */
@@ -176,7 +179,7 @@ tty0SetAttributes (int minor, const struct termios *t)
 {
   int baud;
 
-  /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */
+  /* FIXME: check c_cflag & CRTSCTS for hardware flow control */
   /* FIXME: check and IMPLEMENT XON/XOFF                     */
   switch (t->c_cflag & CBAUD) {
   default:	baud = -1;	break;
@@ -323,8 +326,7 @@ static rtems_isr tty0serial_ISR(rtems_vector_number v)
  * deinit TTY0
  *
  */
-void
-tty0DeInit(void)
+static void tty0DeInit(void)
 {
   /*
    * disable interrupts for serial tty0port
@@ -343,7 +345,7 @@ tty0DeInit(void)
  * init SPI
  *
  */
-rtems_status_code
+static rtems_status_code
 tty0Initialize(void)
 {
   register unsigned tmp;
@@ -370,6 +372,7 @@ tty0Initialize(void)
 
   /* Disable tty0port interrupts while changing hardware */
   _ier = tty0port->IER;
+  (void) _ier; /* avoid set but not used warning */
   tty0port->IER = 0;
 
   /* set up tty0port control: 8 bit,1 stop,no parity */
@@ -395,6 +398,7 @@ tty0Initialize(void)
     _tmp = tty0port->LSR;
     _tmp = tty0port->RBR;
     _tmp = tty0port->MSR;
+    (void) _tmp; /* avoid set but not used warning */
 
     /* Enable recive interrupts, don't enable TxInt yet */
     tty0port->IER=IER_RCV;
-- 
1.9.3




More information about the devel mailing list