[PATCH 46/54] libcpu/bfin/clock: Fix warnings

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


---
 c/src/lib/libcpu/bfin/clock/clock.c | 51 ++++++++-----------------------------
 c/src/lib/libcpu/bfin/clock/rtc.c   | 22 ++++++++--------
 2 files changed, 21 insertions(+), 52 deletions(-)

diff --git a/c/src/lib/libcpu/bfin/clock/clock.c b/c/src/lib/libcpu/bfin/clock/clock.c
index 7bd5d34..391347c 100644
--- a/c/src/lib/libcpu/bfin/clock/clock.c
+++ b/c/src/lib/libcpu/bfin/clock/clock.c
@@ -1,5 +1,7 @@
 /*  RTEMS Clock Tick Driver for Blackfin.  Uses Blackfin Core Timer.
- *
+ */
+
+/*
  *  Copyright (c) 2008 Kallisti Labs, Los Gatos, CA, USA
  *             written by Allan Hessenflow <allanh at kallisti.com>
  *
@@ -25,13 +27,6 @@ volatile uint32_t Clock_driver_ticks;
 
 void Clock_exit(void);
 
-/*
- *  Major and minor number.
- */
-
-rtems_device_major_number rtems_clock_major = ~0;
-rtems_device_minor_number rtems_clock_minor;
-
 static rtems_isr clockISR(rtems_vector_number vector) {
 
   Clock_driver_ticks += 1;
@@ -49,23 +44,14 @@ static rtems_isr clockISR(rtems_vector_number vector) {
 #endif
 }
 
-
 /*
  *  Clock_exit
  *
  *  This routine allows the clock driver to exit by masking the interrupt and
  *  disabling the clock's counter.
- *
- *  Input parameters:   NONE
- *
- *  Output parameters:  NONE
- *
- *  Return values:      NONE
- *
  */
-
-void Clock_exit(void) {
-
+void Clock_exit(void)
+{
   *(uint32_t volatile *) TCNTL = 0;
 }
 
@@ -73,22 +59,13 @@ void Clock_exit(void) {
  *  Clock_initialize
  *
  *  This routine initializes the clock driver.
- *
- *  Input parameters:
- *    major - clock device major number
- *    minor - clock device minor number
- *    parg  - pointer to optional device driver arguments
- *
- *  Output parameters:  NONE
- *
- *  Return values:
- *    rtems_device_driver status code
  */
-
-rtems_device_driver Clock_initialize(rtems_device_major_number major,
-                                     rtems_device_minor_number minor,
-                                     void *pargp) {
-
+rtems_device_driver Clock_initialize(
+  rtems_device_major_number major,
+  rtems_device_minor_number minor,
+  void *pargp
+)
+{
   Clock_driver_ticks = 0;
 
   set_vector(clockISR, CEC_CORE_TIMER_VECTOR, 1);
@@ -100,12 +77,6 @@ rtems_device_driver Clock_initialize(rtems_device_major_number major,
   *(uint32_t volatile *) TCNTL = TCNTL_TMPWR | TCNTL_TAUTORLD | TCNTL_TMREN;
 
   atexit(Clock_exit);
-  /*
-   * make major/minor avail to others such as shared memory driver
-   */
-
-  rtems_clock_major = major;
-  rtems_clock_minor = minor;
 
   return RTEMS_SUCCESSFUL;
 }
diff --git a/c/src/lib/libcpu/bfin/clock/rtc.c b/c/src/lib/libcpu/bfin/clock/rtc.c
index 17f2cf7..9efcb89 100644
--- a/c/src/lib/libcpu/bfin/clock/rtc.c
+++ b/c/src/lib/libcpu/bfin/clock/rtc.c
@@ -1,5 +1,7 @@
 /*  Real Time Clock Driver for Blackfin
- *
+ */
+
+/*
  *  Copyright (c) 2006 by Atos Automacao Industrial Ltda.
  *             written by Alain Schaefer <alain.schaefer at easc.ch>
  *                    and Antonio Giovanini <antonio at atos.com.br>
@@ -30,13 +32,12 @@ int Leap_years_until_now (int year);
 
 void Init_RTC(void)
 {
-  *((uint16_t*)RTC_PREN)    = RTC_PREN_PREN; /* Enable Prescaler */
+  *((uint16_t*)RTC_PREN) = RTC_PREN_PREN; /* Enable Prescaler */
 }
 
 /*
  *  Read time from RTEMS' clock manager and set it to RTC
  */
-
 void setRealTimeFromRTEMS (void)
 {
   rtems_time_of_day time_buffer;
@@ -51,7 +52,6 @@ void setRealTimeFromRTEMS (void)
 /*
  *  Read real time from RTC and set it to RTEMS' clock manager
  */
-
 void setRealTimeToRTEMS (void)
 {
   rtems_time_of_day time_buffer;
@@ -60,9 +60,9 @@ void setRealTimeToRTEMS (void)
   rtems_clock_set( &time_buffer );
 }
 
- /*
-  * Set the RTC time
-  */
+/*
+ * Set the RTC time
+ */
 int setRealTime(
   const rtems_time_of_day *tod
 )
@@ -87,10 +87,9 @@ int setRealTime(
   return 0;
 }
 
- /*
-  *  Get the time from the RTC.
-  */
-
+/*
+ *  Get the time from the RTC.
+ */
 void getRealTime(
   rtems_time_of_day *tod
 )
@@ -134,7 +133,6 @@ void getRealTime(
  *  Return the difference between RTC and RTEMS' clock manager time in minutes.
  *  If the difference is greater than 1 day, this returns 9999.
  */
-
 int checkRealTime (void)
 {
   rtems_time_of_day rtems_tod;
-- 
1.9.3




More information about the devel mailing list