[PATCH 45/62] mpc8260 libcpu and mpc6260ads BSP: Fix warnings

Joel Sherrill joel.sherrill at oarcorp.com
Wed Oct 15 20:00:35 UTC 2014


---
 .../libbsp/powerpc/mpc8260ads/console/console.c    | 28 +++----
 c/src/lib/libbsp/powerpc/mpc8260ads/include/bsp.h  | 20 ++---
 c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c      |  4 +-
 .../libbsp/powerpc/mpc8260ads/startup/bspstart.c   | 59 ++++++--------
 c/src/lib/libbsp/powerpc/shared/startup/bspidle.c  |  4 +-
 .../mpc8260/console-generic/console-generic.c      | 45 +++--------
 c/src/lib/libcpu/powerpc/mpc8260/cpm/brg.c         | 92 +++++++++++-----------
 7 files changed, 105 insertions(+), 147 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c b/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
index a6497aa..9a020c8 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/console/console.c
@@ -1,6 +1,4 @@
 /*
- *  console.c
- *
  *  This file contains the MBX8xx termios serial I/O package.
  *  Only asynchronous I/O is supported.
  *
@@ -14,6 +12,16 @@
  *    SCC3      /dev/tty3      4
  *    SCC4      /dev/tty4      5
  *
+ * The SCCs and SMCs on the eval board are assigned as follows
+ *
+ *   Channel     Device      Minor   Termios
+ *    SMC1      /dev/tty3      4       no
+ *    SMC2      /dev/tty4      5       no
+ *    SCC1      /dev/tty0      0       no
+ *    SCC2      /dev/console   1       yes
+ *    SCC3      /dev/tty1      2       no  	* USED FOR NETWORK I/F
+ *    SCC4      /dev/tty2      3       no	* USED FOR NETWORK I/F
+ *
  *  All ports support termios. The use of termios is recommended for real-time
  *  applications. Termios provides buffering and input processing. When not
  *  using termios, processing is limited to the substitution of LF for CR on
@@ -64,7 +72,9 @@
  *  the sub-devices using minor device numbers. It is not possible to have
  *  other protocols running on the other ports when this driver is used as
  *  currently written.
- *
+ */
+
+/*
  *  Based on code (alloc860.c in eth_comm port) by
  *  Jay Monkman (jmonkman at frasca.com),
  *  Copyright (C) 1998 by Frasca International, Inc.
@@ -75,17 +85,6 @@
  *
  *  Modifications by Andy Dachs <iwe at fsmal.net> for MPC8260
  *  support.
- *
- * The SCCs and SMCs on the eval board are assigned as follows
- *
- *   Channel     Device      Minor   Termios
- *    SMC1      /dev/tty3      4       no
- *    SMC2      /dev/tty4      5       no
- *    SCC1      /dev/tty0      0       no
- *    SCC2      /dev/console   1       yes
- *    SCC3      /dev/tty1      2       no  	* USED FOR NETWORK I/F
- *    SCC4      /dev/tty2      3       no	* USED FOR NETWORK I/F
- *
  */
 #include <stdarg.h>
 #include <stdio.h>
@@ -451,7 +450,6 @@ rtems_device_driver console_control(
 /*
  *  Support routine for console-generic
  */
-
 int mbx8xx_console_get_configuration(void)
 {
 #if UARTS_IO_MODE == 1
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/include/bsp.h b/c/src/lib/libbsp/powerpc/mpc8260ads/include/bsp.h
index 781e5d7..a3511fd 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/include/bsp.h
@@ -1,10 +1,9 @@
-/*  bsp.h
- *
+/*
  *  This include file contains all board IO definitions.
- *
- *  XXX : put yours in here
- *
- *  COPYRIGHT (c) 1989-1999.
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2014.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -46,12 +45,6 @@ typedef struct bcsr
 
 } BCSR;
 
-#define UART1_E	0x02000002		/* bit 6 of BCSR1 */
-#define UART2_E	0x01000001		/* bit 7 of BCSR1 */
-
-#define GP0_LED 0x02000002    /*  bit 6 of BCSR0 */
-#define GP1_LED 0x01000001    /*  bit 7 of BCSR0 */
-
 /*
  * Network driver configuration
  */
@@ -84,6 +77,9 @@ extern char M8260DefaultWatchdogFeeder;
  * Prototypes for items shared across file boundaries in the BSP
  */
 extern uint32_t bsp_serial_per_sec;
+void *bsp_idle_thread( uintptr_t ignored );
+void  cpu_init(void);
+int mbx8xx_console_get_configuration(void);
 
 #ifdef __cplusplus
 }
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c b/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c
index 0d8fb26..52465ec 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/irq/irq.c
@@ -211,7 +211,7 @@ volatile unsigned int maxLoop = 0;
 /*
  * High level IRQ handler called from shared_raw_irq_code_entry
  */
-int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
+static int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
 {
   register unsigned int irq;
 #if 0
@@ -310,7 +310,7 @@ int C_dispatch_irq_handler (BSP_Exception_frame *frame, unsigned excNum)
 /*
  * Initialize CPM interrupt management
  */
-void
+static void
 BSP_CPM_irq_init(void)
 {
    m8260.simr_l = 0;
diff --git a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
index 3f0ccca..3aa1659 100644
--- a/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
+++ b/c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c
@@ -49,6 +49,12 @@
 
 #include <string.h>
 
+#define UART1_E	0x02000002		/* bit 6 of BCSR1 */
+#define UART2_E	0x01000001		/* bit 7 of BCSR1 */
+
+#define GP0_LED 0x02000002    /*  bit 6 of BCSR0 */
+#define GP1_LED 0x01000001    /*  bit 7 of BCSR0 */
+
 SPR_RW(SPRG1)
 
 /*
@@ -66,83 +72,64 @@ uint32_t   bsp_timer_average_overhead; /* Average overhead of timer in ticks */
 uint32_t   bsp_timer_least_valid;      /* Least valid number from timer      */
 bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
 
-void  _BSP_GPLED1_on(void);
-void  _BSP_GPLED0_on(void);
-void  cpu_init(void);
-
 extern char IntrStack_start [];
 extern char intrStack [];
 
-void BSP_panic(char *s)
-{
-  _BSP_GPLED1_on();
-  printk("%s PANIC %s\n",_RTEMS_version, s);
-  __asm__ __volatile ("sc");
-}
-
-void _BSP_Fatal_error(unsigned int v)
-{
-  _BSP_GPLED0_on();
-  _BSP_GPLED1_on();
-  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
-  __asm__ __volatile ("sc");
-}
-
-void _BSP_GPLED0_on(void)
+static void _BSP_GPLED0_on(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
   csr->bcsr0 &=  ~GP0_LED;		/* Turn on GP0 LED */
 }
 
-void _BSP_GPLED0_off(void)
+static void _BSP_GPLED0_off(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
   csr->bcsr0 |=  GP0_LED;		/* Turn off GP0 LED */
 }
 
-void _BSP_GPLED1_on(void)
+static void _BSP_GPLED1_on(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
   csr->bcsr0 &=  ~GP1_LED;		/* Turn on GP1 LED */
 }
 
-void _BSP_GPLED1_off(void)
+static void _BSP_GPLED1_off(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
   csr->bcsr0 |=  GP1_LED;		/* Turn off GP1 LED */
 }
 
-void _BSP_Uart1_enable(void)
+void BSP_panic(char *s)
 {
-  BCSR *csr;
-  csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
-  csr->bcsr1 &= ~UART1_E;		/* Enable Uart1 */
+  _BSP_GPLED1_on();
+  printk("%s PANIC %s\n",_RTEMS_version, s);
+  __asm__ __volatile ("sc");
 }
 
-void _BSP_Uart1_disable(void)
+void _BSP_Fatal_error(unsigned int v)
 {
-  BCSR *csr;
-  csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
-  csr->bcsr1 |=  UART1_E;		/* Disable Uart1 */
+  _BSP_GPLED0_on();
+  _BSP_GPLED1_on();
+  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
+  __asm__ __volatile ("sc");
 }
 
-void _BSP_Uart2_enable(void)
+static void _BSP_Uart1_enable(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
-  csr->bcsr1 &= ~UART2_E;		/* Enable Uart2 */
+  csr->bcsr1 &= ~UART1_E;		/* Enable Uart1 */
 }
 
-void _BSP_Uart2_disable(void)
+static void _BSP_Uart2_enable(void)
 {
   BCSR *csr;
   csr = (BCSR *)(m8260.memc[1].br & 0xFFFF8000);
-  csr->bcsr1 |=  UART2_E;		/* Disable Uart2 */
-
+  csr->bcsr1 &= ~UART2_E;		/* Enable Uart2 */
 }
 
 void bsp_start(void)
diff --git a/c/src/lib/libbsp/powerpc/shared/startup/bspidle.c b/c/src/lib/libbsp/powerpc/shared/startup/bspidle.c
index c916935..de37fa1 100644
--- a/c/src/lib/libbsp/powerpc/shared/startup/bspidle.c
+++ b/c/src/lib/libbsp/powerpc/shared/startup/bspidle.c
@@ -1,6 +1,8 @@
 /*
  *  Moved to libbsp/powerpc/shared by Joel Sherrill (9 Sept 09).
- *
+ */
+
+/*
  *  The MPC860 specific stuff was written by Jay Monkman (jmonkman at frasca.com)
  *
  *  Modified for the MPC8260ADS board by Andy Dachs <a.dachs at sstl.co.uk>
diff --git a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
index bc5f993..022e16e 100644
--- a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
+++ b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
@@ -20,6 +20,9 @@
  *    BRG2
  *    BRG3
  *    BRG4
+ */
+
+/*
  *  Author: Jay Monkman (jmonkman at frasca.com)
  *  Copyright (C) 1998 by Frasca International, Inc.
  *
@@ -59,12 +62,9 @@
 #include <bsp/irq.h>
 #include <rtems/bspIo.h>   /* for printk */
 
-
-
 /* BSP supplied routine */
 extern int mbx8xx_console_get_configuration(void);
 
-
 /*
  * Interrupt-driven input buffer
  */
@@ -83,8 +83,6 @@ static volatile char txBuf[NUM_PORTS];
 /* SCC/SMC buffer descriptors */
 static volatile m8260BufferDescriptor_t *RxBd[NUM_PORTS], *TxBd[NUM_PORTS];
 
-
-
 /* Used to track termios private data for callbacks */
 struct rtems_termios_tty *ttyp[NUM_PORTS];
 
@@ -105,8 +103,6 @@ static rtems_isr m8xx_scc2_interrupt_handler(rtems_irq_hdl_param unused);
 static rtems_isr m8xx_scc3_interrupt_handler(rtems_irq_hdl_param unused);
 static rtems_isr m8xx_scc4_interrupt_handler(rtems_irq_hdl_param unused);
 
-
-
 /*
  * Hardware-dependent portion of tcsetattr().
  */
@@ -223,7 +219,6 @@ m8xx_smc_set_attributes (int minor, const struct termios *t)
   return 0;
 }
 
-
 static int
 m8xx_scc_set_attributes (int minor, const struct termios *t)
 {
@@ -315,7 +310,6 @@ m8xx_scc_set_attributes (int minor, const struct termios *t)
   return 0;
 }
 
-
 int
 m8xx_uart_setAttributes(
   int minor,
@@ -342,11 +336,9 @@ m8xx_uart_setAttributes(
   return 0;
 }
 
-
 /*
  * Interrupt handlers
  */
-
 static void
 m8xx_scc1_interrupt_handler (rtems_irq_hdl_param unused)
 {
@@ -431,7 +423,6 @@ m8xx_scc2_interrupt_handler (rtems_irq_hdl_param unused)
 #endif
 }
 
-
 static void
 m8xx_scc3_interrupt_handler (rtems_irq_hdl_param unused)
 {
@@ -475,7 +466,6 @@ m8xx_scc3_interrupt_handler (rtems_irq_hdl_param unused)
 #endif
 }
 
-
 static void
 m8xx_scc4_interrupt_handler (rtems_irq_hdl_param unused)
 {
@@ -560,7 +550,6 @@ m8xx_smc1_interrupt_handler (rtems_irq_hdl_param unused)
 #endif
 }
 
-
 static void
 m8xx_smc2_interrupt_handler (rtems_irq_hdl_param unused)
 {
@@ -603,8 +592,7 @@ m8xx_smc2_interrupt_handler (rtems_irq_hdl_param unused)
 #endif
 }
 
-
-void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
+static void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
 {
   volatile m8260SCCRegisters_t *sccregs = 0;
   switch (ptr->name) {
@@ -630,7 +618,7 @@ void m8xx_scc_enable(const rtems_irq_connect_data* ptr)
   sccregs->sccm = 3;
 }
 
-void m8xx_scc_disable(const rtems_irq_connect_data* ptr)
+static void m8xx_scc_disable(const rtems_irq_connect_data* ptr)
 {
   volatile m8260SCCRegisters_t *sccregs = 0;
   switch (ptr->name) {
@@ -652,7 +640,7 @@ void m8xx_scc_disable(const rtems_irq_connect_data* ptr)
   sccregs->sccm &= (~3);
 }
 
-int m8xx_scc_isOn(const rtems_irq_connect_data* ptr)
+static int m8xx_scc_isOn(const rtems_irq_connect_data* ptr)
 {
  return BSP_irq_enabled_at_cpm (ptr->name);
 }
@@ -667,7 +655,6 @@ static rtems_irq_connect_data consoleIrqData =
   (rtems_irq_is_enabled) m8xx_scc_isOn
 };
 
-
 void
 m8xx_uart_scc_initialize (int minor)
 {
@@ -729,9 +716,6 @@ m8xx_uart_scc_initialize (int minor)
   sccparms->rbase = (char *)RxBd[minor] - (char *)&m8260;
   sccparms->tbase = (char *)TxBd[minor] - (char *)&m8260;
 
-
-
-
   sccparms->rfcr = M8260_RFCR_MOT | M8260_RFCR_60X_BUS;
   sccparms->tfcr = M8260_TFCR_MOT | M8260_TFCR_60X_BUS;
   if ( (mbx8xx_console_get_configuration() & 0x06) == 0x02 )
@@ -759,7 +743,6 @@ m8xx_uart_scc_initialize (int minor)
   sccparms->un.uart.character[6] = 0x8000; /* Entry is invalid */
   sccparms->un.uart.character[7] = 0x8000; /* Entry is invalid */
 
-
   sccparms->un.uart.rccm = 0xc0ff;  /* No masking */
 
   /*
@@ -831,9 +814,7 @@ m8xx_uart_scc_initialize (int minor)
   }
 }
 
-
-
-void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
+static void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
 {
   volatile m8260SMCRegisters_t *smcregs = 0;
   switch (ptr->name) {
@@ -849,7 +830,7 @@ void m8xx_smc_enable(const rtems_irq_connect_data* ptr)
   smcregs->smcm = 3;
 }
 
-void m8xx_smc_disable(const rtems_irq_connect_data* ptr)
+static void m8xx_smc_disable(const rtems_irq_connect_data* ptr)
 {
   volatile m8260SMCRegisters_t *smcregs = 0;
   switch (ptr->name) {
@@ -865,12 +846,11 @@ void m8xx_smc_disable(const rtems_irq_connect_data* ptr)
   smcregs->smcm &= (~3);
 }
 
-int m8xx_smc_isOn(const rtems_irq_connect_data* ptr)
+static int m8xx_smc_isOn(const rtems_irq_connect_data* ptr)
 {
  return BSP_irq_enabled_at_cpm (ptr->name);
 }
 
-
 void
 m8xx_uart_smc_initialize (int minor)
 {
@@ -889,6 +869,7 @@ m8xx_uart_smc_initialize (int minor)
     brg = m8xx_get_brg(M8260_SMC1_BRGS, 9600*16);
   else
     brg = m8xx_get_brg(M8260_SMC2_BRGS, 9600*16);
+  (void) brg; /* avoid set but not used warning */
 
   /*
    * Allocate buffer descriptors
@@ -1036,10 +1017,8 @@ m8xx_uart_smc_initialize (int minor)
 void
 m8xx_uart_initialize(void)
 {
-
 }
 
-
 void
 m8xx_uart_interrupts_initialize(void)
 {
@@ -1055,11 +1034,9 @@ m8xx_uart_interrupts_initialize(void)
   m8xx.cicr = 0x00043F80;           /* SCaP=SCC1, SCbP=SCC2, IRL=1, HP=PC15, IEN=1 */
 #endif
   m8xx.simask |= M8xx_SIMASK_LVM1;  /* Enable level interrupts */
-
 #endif
 }
 
-
 int
 m8xx_uart_pollRead(
   int minor
@@ -1079,7 +1056,6 @@ m8xx_uart_pollRead(
   return c;
 }
 
-
 /*
  *  TODO: Get a free buffer and set it up.
  */
@@ -1102,7 +1078,6 @@ m8xx_uart_write(
   return 0;
 }
 
-
 ssize_t
 m8xx_uart_pollWrite(
   int minor,
diff --git a/c/src/lib/libcpu/powerpc/mpc8260/cpm/brg.c b/c/src/lib/libcpu/powerpc/mpc8260/cpm/brg.c
index aef8ca8..741f131 100644
--- a/c/src/lib/libcpu/powerpc/mpc8260/cpm/brg.c
+++ b/c/src/lib/libcpu/powerpc/mpc8260/cpm/brg.c
@@ -10,7 +10,9 @@
  *
  *  *** All attempts to allocate a BRG or CLK line should be made via
  *      calls to these routines or they simply won't work.
- *
+ */
+
+/*
  *  Author: Andy Dachs <a.dachs at sstl.co.uk>
  *  Copyright Surrey Satellite Technology Limited (SSTL), 2001
  *
@@ -30,7 +32,7 @@
  *  http://www.rtems.org/license/LICENSE.
  */
 
-#include <rtems.h>
+#include <bsp.h>
 #include <mpc8260.h>
 #include <mpc8260/cpm.h>
 #include <rtems/bspIo.h>
@@ -43,7 +45,6 @@
 static unsigned long brg_spd[NUM_BRGS];
 static unsigned int brg_use_count[NUM_BRGS];
 
-
 /* Used to track the usage of the clock inputs */
 /* (initialised to zeros) */
 static unsigned int clk_use_count[NUM_BRGS];
@@ -66,7 +67,6 @@ m8xx_get_brg_cd (int baud)
     ((divisor - 1) << 1) | div16;
 }
 
-
 /*
  *  Allocates an existing brg if one is already programmed for the same
  *  baud rate.  Otherwise a new brg is assigned
@@ -80,7 +80,7 @@ m8xx_get_brg(unsigned brgmask, int baud)
 
   /* first try to find a BRG that is already at the right speed */
   for ( i = 0; i < NUM_BRGS; i++ ) {
-    if( (1 << i) & brgmask )		/* is this brg allowed? */
+    if ( (1 << i) & brgmask )    /* is this brg allowed? */
       if ( brg_spd[i] == baud ) {
         break;
     }
@@ -97,38 +97,38 @@ m8xx_get_brg(unsigned brgmask, int baud)
     brg_use_count[i]++;
     brg_spd[i]=baud;
     switch (i) {
-   	case 0:
-      		m8260.brgc1 = M8260_BRG_RST;
-      		m8260.brgc1 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 1:
-      		m8260.brgc2 = M8260_BRG_RST;
-      		m8260.brgc2 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 2:
-      		m8260.brgc3 = M8260_BRG_RST;
-      		m8260.brgc3 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 3:
-      		m8260.brgc4 = M8260_BRG_RST;
-      		m8260.brgc4 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 4:
-      		m8260.brgc5 = M8260_BRG_RST;
-      		m8260.brgc5 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 5:
-      		m8260.brgc6 = M8260_BRG_RST;
-      		m8260.brgc6 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 6:
-      		m8260.brgc7 = M8260_BRG_RST;
-      		m8260.brgc7 = m8xx_get_brg_cd(baud);
-      		break;
-    	case 7:
-      		m8260.brgc8 = M8260_BRG_RST;
-      		m8260.brgc8 = m8xx_get_brg_cd(baud);
-      		break;
+      case 0:
+        m8260.brgc1 = M8260_BRG_RST;
+        m8260.brgc1 = m8xx_get_brg_cd(baud);
+        break;
+      case 1:
+        m8260.brgc2 = M8260_BRG_RST;
+        m8260.brgc2 = m8xx_get_brg_cd(baud);
+        break;
+      case 2:
+        m8260.brgc3 = M8260_BRG_RST;
+        m8260.brgc3 = m8xx_get_brg_cd(baud);
+        break;
+      case 3:
+        m8260.brgc4 = M8260_BRG_RST;
+        m8260.brgc4 = m8xx_get_brg_cd(baud);
+        break;
+      case 4:
+        m8260.brgc5 = M8260_BRG_RST;
+        m8260.brgc5 = m8xx_get_brg_cd(baud);
+        break;
+      case 5:
+        m8260.brgc6 = M8260_BRG_RST;
+        m8260.brgc6 = m8xx_get_brg_cd(baud);
+        break;
+      case 6:
+        m8260.brgc7 = M8260_BRG_RST;
+        m8260.brgc7 = m8xx_get_brg_cd(baud);
+        break;
+      case 7:
+        m8260.brgc8 = M8260_BRG_RST;
+        m8260.brgc8 = m8xx_get_brg_cd(baud);
+        break;
     }
     return i;
   }
@@ -147,19 +147,19 @@ m8xx_get_brg(unsigned brgmask, int baud)
 void
 m8xx_free_brg( int brg_num )
 {
-  if( (brg_num>=0) && (brg_num<NUM_BRGS) )
-     if(brg_use_count[brg_num] > 0 )
-       brg_use_count[brg_num]--;
+  if ( (brg_num>=0) && (brg_num<NUM_BRGS) )
+    if (brg_use_count[brg_num] > 0 )
+      brg_use_count[brg_num]--;
 }
 
-
-void m8xx_dump_brgs( void )
+#ifdef DEBUG_BRG
+static void m8xx_dump_brgs( void )
 {
   int i;
-  for(i=0; i<NUM_BRGS; i++ )
+  for (i=0; i<NUM_BRGS; i++ )
     printk( "Brg[%d]: %d %d\n", i, brg_use_count[i], brg_spd[i] );
 }
-
+#endif
 
 /*
  * Reserve one of a range of clock inputs
@@ -192,7 +192,7 @@ m8xx_get_clk( unsigned clkmask )
 void
 m8xx_free_clk( int clk_num )
 {
-  if( (clk_num>=0) && (clk_num<NUM_BRGS) )
-     if(clk_use_count[clk_num] > 0 )
+  if ( (clk_num>=0) && (clk_num<NUM_BRGS) )
+     if (clk_use_count[clk_num] > 0 )
        clk_use_count[clk_num]--;
 }
-- 
1.9.3




More information about the devel mailing list