From 4105121e04443da4b00fcf4111b88032b276fe2c Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 9 Dec 2010 19:29:08 -0800 Subject: [PATCH] --- yaml --- r: 227609 b: refs/heads/master c: 504499f22c08a03e2e19dc88d31aa0ecd2ac815e h: refs/heads/master i: 227607: 3dd7f2bff920c5942acbacf5ace4896b439d87cf v: v3 --- [refs] | 2 +- trunk/drivers/hid/hid-core.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 699ec30b0dca..7dab74fdb181 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a3789a1783d37f2772ba5046b26416c98dfe1bfa +refs/heads/master: 504499f22c08a03e2e19dc88d31aa0ecd2ac815e diff --git a/trunk/drivers/hid/hid-core.c b/trunk/drivers/hid/hid-core.c index 86b7155632fb..d4c1906313d2 100644 --- a/trunk/drivers/hid/hid-core.c +++ b/trunk/drivers/hid/hid-core.c @@ -178,10 +178,14 @@ static int close_collection(struct hid_parser *parser) static unsigned hid_lookup_collection(struct hid_parser *parser, unsigned type) { + struct hid_collection *collection = parser->device->collection; int n; - for (n = parser->collection_stack_ptr - 1; n >= 0; n--) - if (parser->device->collection[parser->collection_stack[n]].type == type) - return parser->device->collection[parser->collection_stack[n]].usage; + + for (n = parser->collection_stack_ptr - 1; n >= 0; n--) { + unsigned index = parser->collection_stack[n]; + if (collection[index].type == type) + return collection[index].usage; + } return 0; /* we know nothing about this usage type */ }