Commit 1496b489 authored by Etienne Carriere's avatar Etienne Carriere
Browse files

delay_timer: correct sparse issues and warnings



Use NULL instead of 0 where required.
Include headers to have the prototype of the functions.
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
Signed-off-by: default avatarEtienne Carriere <etienne.carriere@st.com>
parent c04d59cf
...@@ -19,10 +19,10 @@ static const timer_ops_t *ops; ...@@ -19,10 +19,10 @@ static const timer_ops_t *ops;
***********************************************************/ ***********************************************************/
void udelay(uint32_t usec) void udelay(uint32_t usec)
{ {
assert(ops != 0 && assert(ops != NULL &&
(ops->clk_mult != 0) && (ops->clk_mult != 0) &&
(ops->clk_div != 0) && (ops->clk_div != 0) &&
(ops->get_timer_value != 0)); (ops->get_timer_value != NULL));
uint32_t start, delta, total_delta; uint32_t start, delta, total_delta;
...@@ -57,10 +57,10 @@ void mdelay(uint32_t msec) ...@@ -57,10 +57,10 @@ void mdelay(uint32_t msec)
***********************************************************/ ***********************************************************/
void timer_init(const timer_ops_t *ops_ptr) 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_mult != 0) &&
(ops_ptr->clk_div != 0) && (ops_ptr->clk_div != 0) &&
(ops_ptr->get_timer_value != 0)); (ops_ptr->get_timer_value != NULL));
ops = ops_ptr; ops = ops_ptr;
} }
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <bl_common.h> #include <bl_common.h>
#include <debug.h> #include <debug.h>
#include <delay_timer.h> #include <delay_timer.h>
#include <generic_delay_timer.h>
#include <platform.h> #include <platform.h>
/* Ticks elapsed in one second by a signal of 1 MHz */ /* Ticks elapsed in one second by a signal of 1 MHz */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment