delay_timer: correct sparse issues and warnings
authorEtienne Carriere <etienne.carriere@st.com>
Wed, 7 Jun 2017 14:42:26 +0000 (16:42 +0200)
committerEtienne Carriere <etienne.carriere@st.com>
Fri, 23 Jun 2017 07:38:08 +0000 (09:38 +0200)
Use NULL instead of 0 where required.
Include headers to have the prototype of the functions.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
drivers/delay_timer/delay_timer.c
drivers/delay_timer/generic_delay_timer.c

index 403c60fdf96ff2636816e7033b9c88ee4497af5a..43f5af7b39d9040aa6a8a0de32418f7488d347c9 100644 (file)
@@ -19,10 +19,10 @@ static const timer_ops_t *ops;
  ***********************************************************/
 void udelay(uint32_t usec)
 {
-       assert(ops != 0 &&
+       assert(ops != NULL &&
                (ops->clk_mult != 0) &&
                (ops->clk_div != 0) &&
-               (ops->get_timer_value != 0));
+               (ops->get_timer_value != NULL));
 
        uint32_t start, delta, total_delta;
 
@@ -57,10 +57,10 @@ void mdelay(uint32_t msec)
  ***********************************************************/
 void timer_init(const timer_ops_t *ops_ptr)
 {
-       assert(ops_ptr != 0  &&
+       assert(ops_ptr != NULL  &&
                (ops_ptr->clk_mult != 0) &&
                (ops_ptr->clk_div != 0) &&
-               (ops_ptr->get_timer_value != 0));
+               (ops_ptr->get_timer_value != NULL));
 
        ops = ops_ptr;
 }
index 6a9d314727c4e7e0414ef55b0757ed2dcd182536..8a36c8abd7ef6349b80c3383b355cfe171e7e20f 100644 (file)
@@ -9,6 +9,7 @@
 #include <bl_common.h>
 #include <debug.h>
 #include <delay_timer.h>
+#include <generic_delay_timer.h>
 #include <platform.h>
 
 /* Ticks elapsed in one second by a signal of 1 MHz */