diff options
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r-- | firmware/kernel.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index e646c2ec9e..1499402f40 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -159,10 +159,9 @@ static void timeout_tick(void) | |||
159 | void timeout_cancel(struct timeout *tmo) | 159 | void timeout_cancel(struct timeout *tmo) |
160 | { | 160 | { |
161 | int oldlevel = disable_irq_save(); | 161 | int oldlevel = disable_irq_save(); |
162 | void **arr = (void **)tmo_list; | 162 | int rc = remove_array_ptr((void **)tmo_list, tmo); |
163 | int rc = remove_array_ptr(arr, tmo); | ||
164 | 163 | ||
165 | if(rc >= 0 && *arr == NULL) | 164 | if(rc >= 0 && *tmo_list == NULL) |
166 | { | 165 | { |
167 | tick_remove_task(timeout_tick); /* Last one - remove task */ | 166 | tick_remove_task(timeout_tick); /* Last one - remove task */ |
168 | } | 167 | } |
@@ -193,7 +192,7 @@ void timeout_register(struct timeout *tmo, timeout_cb_type callback, | |||
193 | if(*p == NULL) | 192 | if(*p == NULL) |
194 | { | 193 | { |
195 | /* Not present */ | 194 | /* Not present */ |
196 | if(*arr == NULL) | 195 | if(*tmo_list == NULL) |
197 | { | 196 | { |
198 | tick_add_task(timeout_tick); /* First one - add task */ | 197 | tick_add_task(timeout_tick); /* First one - add task */ |
199 | } | 198 | } |