Skip to content

Commit

Permalink
HID: hid-sensor-hub: Fix sparse warning
Browse files Browse the repository at this point in the history
Since I can't change the type of hid_set_field argument 3, using __force __s32 to remove
this warning.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Srinivas Pandruvada authored and Jiri Kosina committed Mar 16, 2015
1 parent eb96483 commit 62fad13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hid/hid-sensor-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
if (buffer_size) {
for (i = 0; i < buffer_size; ++i) {
hid_set_field(report->field[field_index], i,
cpu_to_le32(*buf32));
(__force __s32)cpu_to_le32(*buf32));
++buf32;
}
}
if (remaining_bytes) {
value = 0;
memcpy(&value, (u8 *)buf32, remaining_bytes);
hid_set_field(report->field[field_index], i,
cpu_to_le32(value));
(__force __s32)cpu_to_le32(value));
}
hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
hid_hw_wait(hsdev->hdev);
Expand Down

0 comments on commit 62fad13

Please sign in to comment.