Commit 1b1b938e authored by Marek Behun's avatar Marek Behun
Browse files

wtmi: clock: Check for zero in ndelay() / udelay()



Otherwise we will interate 2**32 cycles.
Signed-off-by: Marek Behun's avatarMarek Behún <marek.behun@nic.cz>
parent c0ee09aa
......@@ -1127,6 +1127,9 @@ void ndelay(u32 ns)
{
u32 loop = NS_TO_LOOPS(ns);
if (!ns)
return;
asm volatile(
"0:\n"
"subs %[count], 1\n"
......@@ -1139,6 +1142,9 @@ void udelay(u32 us)
{
u32 loop = US_TO_LOOPS(us);
if (!us)
return;
asm volatile(
"0:\n"
"subs %[count], 1\n"
......
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