Skip to content

Commit d6ea85f

Browse files
vishnuocvJiri Kosina
authored andcommitted
HID: lenovo: Fix to ensure the data as __le32 instead of u32
Ensure that data is treated as __le32 instead of u32 before applying le32_to_cpu. This patch fixes the sparse warning "sparse: cast to restricted __le32". Signed-off-by: Vishnu Sankar <[email protected]> Signed-off-by: Vishnu Sankar <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Jiri Kosina <[email protected]>
1 parent 58c9bf3 commit d6ea85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-lenovo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ static int lenovo_raw_event(struct hid_device *hdev,
778778
if (unlikely((hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB
779779
|| hdev->product == USB_DEVICE_ID_LENOVO_X12_TAB2)
780780
&& size >= 3 && report->id == 0x03))
781-
return lenovo_raw_event_TP_X12_tab(hdev, le32_to_cpu(*(u32 *)data));
781+
return lenovo_raw_event_TP_X12_tab(hdev, le32_to_cpu(*(__le32 *)data));
782782

783783
return 0;
784784
}

0 commit comments

Comments
 (0)