HID: lenovo: Fix to ensure the data as __le32 instead of u32
Subsystems (2)
PATCH 1/1 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]>
--- drivers/hid/hid-lenovo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-lenovo.c +1 -1
@@ -783,7 +783,7 @@ static int lenovo_raw_event(struct hid_device *hdev,if (unlikely ((hdev->product ==USB_DEVICE_ID_LENOVO_X12_TAB || hdev->product ==USB_DEVICE_ID_LENOVO_X12_TAB2 ) && size >=3 && report->id ==0x03 )) -return lenovo_raw_event_TP_X12_tab (hdev,le32_to_cpu (*(u32 *)data)); +return lenovo_raw_event_TP_X12_tab (hdev,le32_to_cpu (*(__le32 *)data));return 0 ; }
Signature · 1 line
2.43.0
Jiri Kosina
maintainerQuoted 8 lines · Vishnu Sankar
Ensure that data is treated as
__le32instead of u32 before applyingle32_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]>
Sorry for the delay, this fell in between cracks. Now applied.
Signature · 2 lines
Jiri Kosina SUSE Labs
Thank you Jiri.
Quoted 18 lines · Jiri Kosina
Quoted 8 lines · Vishnu Sankar
Ensure that data is treated as
__le32instead of u32 before applyingle32_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]>Sorry for the delay, this fell in between cracks. Now applied.
--
Jiri Kosina
SUSE Labs
Signature · 4 lines
Regards,
Vishnu Sankar
+817015150407 (Japan)