summaryrefslogtreecommitdiff
path: root/board/dingdong
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2016-03-23 12:45:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-04-18 17:32:40 -0700
commit068cd0850684ee28a5a514e5a270edce2edb3979 (patch)
treee84f2316e37baa72f1c9611e665749d91a3ce8fd /board/dingdong
parent1e7c280491232110e1006d545f9a61ca05d469d5 (diff)
downloadchrome-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/dingdong')
-rw-r--r--board/dingdong/board.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/board/dingdong/board.c b/board/dingdong/board.c
index 5091494dfb..ae79cb5b6b 100644
--- a/board/dingdong/board.c
+++ b/board/dingdong/board.c
@@ -74,7 +74,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)
@@ -83,9 +83,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;
}