Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196271
b: refs/heads/master
c: 75c28df
h: refs/heads/master
i:
  196269: 7641ea7
  196267: d6b293b
  196263: d18d5e6
  196255: 3682353
v: v3
  • Loading branch information
Pete Zaitcev authored and Jiri Kosina committed Apr 13, 2010
1 parent 5a7da22 commit 0f2a26a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dec143a50c01ca0cc0afcbf5ea4bb8e87981edf
refs/heads/master: 75c28df87eb6d8e1389af67f26fbe2394e28385e
6 changes: 1 addition & 5 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,13 +940,8 @@ static void hid_output_field(struct hid_field *field, __u8 *data)
unsigned count = field->report_count;
unsigned offset = field->report_offset;
unsigned size = field->report_size;
unsigned bitsused = offset + count * size;
unsigned n;

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

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 All @@ -966,6 +961,7 @@ void hid_output_report(struct hid_report *report, __u8 *data)
if (report->id > 0)
*data++ = report->id;

memset(data, 0, ((report->size - 1) >> 3) + 1);
for (n = 0; n < report->maxfield; n++)
hid_output_field(report->field[n], data);
}
Expand Down

0 comments on commit 0f2a26a

Please sign in to comment.