[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<erazor_de@xxxxxxxxxxxxxxxxxxxxx>, Jiri Kosina <jikos@xxxxxxxxxx>,
Benjamin Tissoires <benjamin.tissoires@xxxxxxxxxx>, linux-input@xxxxxxxxxxxxxxx
Bcc: 
Subject: [PATCH] hid: roccat: Convert type uint16_t to __le16
Reply-To: 

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@xxxxxxxxx>
---
 drivers/hid/hid-roccat-kone.c | 2 +-
 drivers/hid/hid-roccat-kone.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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__));
 
 /*
-- 
2.21.0




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux