Skip to content

Commit

Permalink
HID: zeroing of bytes in output fields is bogus
Browse files Browse the repository at this point in the history
This patch removes bogus zeroing of unused bits in output reports,
introduced in Simon's patch in commit d4ae650.
According to the specification, any sane device should not care
about values of unused bits.

What is worse, the zeroing is done in a way which is broken and
might clear certain bits in output reports which are actually
_used_ - a device that has multiple fields with one value of
the size 1 bit each might serve as an example of why this is
bogus - the second call of hid_output_report() would clear the
first bit of report, which has already been set up previously.

This patch will break LEDs on SpaceNavigator, because this device
is broken and takes into account the bits which it shouldn't touch.
The quirk for this particular device will be provided in a separate
patch.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Mar 12, 2007
1 parent 47a80ed commit d108d4f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,6 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
unsigned size = field->report_size;
unsigned n;

/* make sure the unused bits in the last byte are zeros */
if (count > 0 && size > 0)
data[(offset+count*size-1)/8] = 0;

for (n = 0; n < count; n++) {
if (field->logical_minimum < 0) /* signed values */
implement(data, offset + n * size, size, s32ton(field->value[n], size));
Expand Down

0 comments on commit d108d4f

Please sign in to comment.