diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-03-23 12:45:28 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-18 17:32:40 -0700 |
commit | 068cd0850684ee28a5a514e5a270edce2edb3979 (patch) | |
tree | e84f2316e37baa72f1c9611e665749d91a3ce8fd /board/hoho | |
parent | 1e7c280491232110e1006d545f9a61ca05d469d5 (diff) | |
download | chrome-ec-068cd0850684ee28a5a514e5a270edce2edb3979.tar.gz |
Deferred: Use deferred_data instead of function pointer
Previously calls to hook_call_deferred were passed the function to call,
which was then looked up in the .rodata.deferred section with a linear
search. This linear search can be replaced with a subtract by passing
the pointer to the deferred_data object created when DECLARE_DEFERRED
was invoked.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
CQ-DEPEND=CL:*255812
TEST=make buildall -j
Change-Id: I951dd1541302875b102dd086154cf05591694440
Reviewed-on: https://chromium-review.googlesource.com/334315
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/hoho')
-rw-r--r-- | board/hoho/board.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/board/hoho/board.c b/board/hoho/board.c index 93329a4001..e6258f19b4 100644 --- a/board/hoho/board.c +++ b/board/hoho/board.c @@ -76,7 +76,7 @@ void hpd_event(enum gpio_signal signal) hpd_prev_ts = now.val; /* All previous hpd level events need to be re-triggered */ - hook_call_deferred(hpd_lvl_deferred, -1); + hook_call_deferred(&hpd_lvl_deferred_data, -1); /* It's a glitch. Previous time moves but level is the same. */ if (cur_delta < HPD_USTREAM_DEBOUNCE_IRQ) @@ -85,9 +85,10 @@ void hpd_event(enum gpio_signal signal) if ((!hpd_prev_level && level) && (cur_delta < HPD_USTREAM_DEBOUNCE_LVL)) /* It's an irq */ - hook_call_deferred(hpd_irq_deferred, 0); + hook_call_deferred(&hpd_irq_deferred_data, 0); else if (cur_delta >= HPD_USTREAM_DEBOUNCE_LVL) - hook_call_deferred(hpd_lvl_deferred, HPD_USTREAM_DEBOUNCE_LVL); + hook_call_deferred(&hpd_lvl_deferred_data, + HPD_USTREAM_DEBOUNCE_LVL); hpd_prev_level = level; } @@ -167,7 +168,7 @@ static void board_init(void) gpio_set_level(GPIO_STM_READY, 1); /* factory test only */ /* Delay needed to allow HDMI MCU to boot. */ - hook_call_deferred(factory_validation_deferred, 200*MSEC); + hook_call_deferred(&factory_validation_deferred_data, 200*MSEC); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); |