diff mbox series

hid: roccat: Convert type uint16_t to __le16

Message ID 20190922114455.GA17050@gmail.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show
Series hid: roccat: Convert type uint16_t to __le16 | expand

Commit Message

Adam Zerella Sept. 22, 2019, 11:44 a.m. UTC
As pointed out by Sparse we have some warnings about
incorrect type assignments.

warning: incorrect type in assignment (different base types)
	expected unsigned short [usertype] checksum
	got restricted __le16 [usertype]
warning: cast to restricted __le16

This patch assumes we want the data type for 'data'
and 'checksum' to be LE based on the cpu_to_le16()
and similar assignments.

Signed-off-by: Adam Zerella <adam.zerella@gmail.com>
---
 drivers/hid/hid-roccat-kone.c | 2 +-
 drivers/hid/hid-roccat-kone.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index 1a6e600197d0..c5434df1f5dc 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -252,7 +252,7 @@  static int kone_get_weight(struct usb_device *usb_dev, int *result)
 static int kone_get_firmware_version(struct usb_device *usb_dev, int *result)
 {
 	int retval;
-	uint16_t data;
+	__le16 data;
 
 	retval = kone_receive(usb_dev, kone_command_firmware_version,
 			&data, 2);
diff --git a/drivers/hid/hid-roccat-kone.h b/drivers/hid/hid-roccat-kone.h
index 4a1a9cb76b08..401037b4aed5 100644
--- a/drivers/hid/hid-roccat-kone.h
+++ b/drivers/hid/hid-roccat-kone.h
@@ -140,7 +140,7 @@  struct kone_settings {
 	uint8_t  unknown2[23];
 	uint8_t  calibration_data[4];
 	uint8_t  unknown3[2];
-	uint16_t checksum;
+	__le16   checksum;
 } __attribute__ ((__packed__));
 
 /*