summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-11-26 01:28:58 +0000
committerVadim Bendebury <vbendeb@chromium.org>2016-11-26 01:29:24 +0000
commitb3a98521228174d58a63d5be6495b4989419e17b (patch)
treec414a4c67861ca527d3036a4bfa8502396e34b9b /common
parent1ece199078c2665b625debd196ca389e5bda58f1 (diff)
downloadchrome-ec-b3a98521228174d58a63d5be6495b4989419e17b.tar.gz
Revert "ec: Improve efficiency of host command dispatcher"
This reverts commit c459c8278ed2dc84100693eab93389a0df9429bd as the fix is not straightforwad, some host command codes in private repos are expressed using C preprecessor which breaks the assumption of this patch that all host commands are expressed as four digit hex numbers. Change-Id: I922de9ae8dbab6eef048463c5c09b1f338152083 Reviewed-on: https://chromium-review.googlesource.com/414492 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/host_command.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/common/host_command.c b/common/host_command.c
index 6a4b491936..3034419503 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -363,30 +363,6 @@ host_packet_bad:
*/
static const struct host_command *find_host_command(int command)
{
-#ifdef CONFIG_HOSTCMD_SECTION_SORTED
- const struct host_command *l, *r, *m;
- uint32_t num, hc_size;
-
-/* Use binary search to locate host command handler */
- l = __hcmds;
- r = __hcmds_end;
- hc_size = sizeof(struct host_command);
-
- while (1) {
- if (l > r)
- return NULL;
-
- num = ((intptr_t)r - (intptr_t)l) / hc_size;
- m = l + (num / 2);
-
- if (m->command < command)
- l = m + 1;
- else if (m->command > command)
- r = m - 1;
- else
- return m;
- }
-#else
const struct host_command *cmd;
for (cmd = __hcmds; cmd < __hcmds_end; cmd++) {
@@ -395,7 +371,6 @@ static const struct host_command *find_host_command(int command)
}
return NULL;
-#endif
}
static void host_command_init(void)