public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Alexandre Ghisoli <alexandre.ghisoli@ycom.ch>
Cc: BlueZ Mailing List <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] hid2usb error
Date: Thu, 19 Feb 2004 19:58:54 +0100	[thread overview]
Message-ID: <1077217133.2767.15.camel@pegasus> (raw)
In-Reply-To: <1077216551.17051.14.camel@pc-04.ycom.ch>

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

Hi Alexandre,

> Can I find this patch somewhere ?

in the Linux USB development mailing list archive. I searched for you
and attached it.

Regards

Marcel


[-- Attachment #2: hid-core.diff --]
[-- Type: text/x-patch, Size: 986 bytes --]

--- linux-2.6.1-orig/drivers/usb/input/hid-core.c	2004-01-08 22:59:44.000000000 -0800
+++ linux-2.6.1/drivers/usb/input/hid-core.c	2004-01-21 15:15:35.000000000 -0800
@@ -224,6 +224,9 @@
 	offset = report->size;
 	report->size += parser->global.report_size * parser->global.report_count;
 
+	if (usages < parser->global.report_count)
+		usages = parser->global.report_count;
+
 	if (usages == 0)
 		return 0; /* ignore padding fields */
 
@@ -235,9 +238,13 @@
 	field->application = hid_lookup_collection(parser, HID_COLLECTION_APPLICATION);
 
 	for (i = 0; i < usages; i++) {
-		field->usage[i].hid = parser->local.usage[i];
+		int j = i;
+		/* Duplicate the last usage we parsed if we have excess values */
+		if (i >= parser->local.usage_index)
+			j = parser->local.usage_index - 1;
+		field->usage[i].hid = parser->local.usage[j];
 		field->usage[i].collection_index =
-			parser->local.collection_index[i];
+			parser->local.collection_index[j];
 	}
 
 	field->maxusage = usages;

  reply	other threads:[~2004-02-19 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-19 16:00 [Bluez-users] hid2usb error Alexandre Ghisoli
2004-02-19 18:33 ` Marcel Holtmann
2004-02-19 18:49   ` Alexandre Ghisoli
2004-02-19 18:58     ` Marcel Holtmann [this message]
2004-02-19 19:58       ` Alexandre Ghisoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1077217133.2767.15.camel@pegasus \
    --to=marcel@holtmann.org \
    --cc=alexandre.ghisoli@ycom.ch \
    --cc=bluez-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox