Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_compat.c
Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Lines | |||||
struct timer_list *timer; | struct timer_list *timer; | ||||
linux_set_current(curthread); | linux_set_current(curthread); | ||||
timer = context; | timer = context; | ||||
timer->function(timer->data); | timer->function(timer->data); | ||||
} | } | ||||
void | int | ||||
mod_timer(struct timer_list *timer, int expires) | mod_timer(struct timer_list *timer, int expires) | ||||
{ | { | ||||
hselasky: Callout reset never fails. Please remove or update this comment.
Either it:
starts timer from… | |||||
Done Inline ActionsSo my original code was right ? manu: So my original code was right ? | |||||
Not Done Inline ActionsYes, looks like, except for only testing ret == 1. Add an assert for the sake of future changes in callout APIs. hselasky: Yes, looks like, except for only testing ret == 1.
Add an assert for the sake of future… | |||||
timer->expires = expires; | timer->expires = expires; | ||||
callout_reset(&timer->callout, | return (callout_reset(&timer->callout, | ||||
hselaskyUnsubmitted Done Inline ActionsPlease read the callout_reset() code that you return exactly what you want! hselasky: Please read the callout_reset() code that you return exactly what you want! | |||||
manuAuthorUnsubmitted Done Inline Actions? manu: ? | |||||
hselaskyUnsubmitted Done Inline ActionsFrom what I know callout functions can return 1,0,-1. Are you sure callout reset only returns 1/0 ? hselasky: From what I know callout functions can return 1,0,-1. Are you sure callout reset only returns… | |||||
manuAuthorUnsubmitted Done Inline ActionsOh mhm, right, I guess I should just ignore <0 like we do now. manu: Oh mhm, right, I guess I should just ignore <0 like we do now.
I'll change that. | |||||
linux_timer_jiffies_until(expires), | linux_timer_jiffies_until(expires), | ||||
&linux_timer_callback_wrapper, timer); | &linux_timer_callback_wrapper, timer)); | ||||
} | } | ||||
void | void | ||||
add_timer(struct timer_list *timer) | add_timer(struct timer_list *timer) | ||||
{ | { | ||||
callout_reset(&timer->callout, | callout_reset(&timer->callout, | ||||
linux_timer_jiffies_until(timer->expires), | linux_timer_jiffies_until(timer->expires), | ||||
▲ Show 20 Lines • Show All 613 Lines • Show Last 20 Lines |
Callout reset never fails. Please remove or update this comment.
Either it:
starts timer from clear (0)
or re-starts timer (1)
MPASS(ret == 0 || ret == 1);
return (ret == 1);