Arnd Bergmann 9e438fe31e HID: intel-ish-hid: fix endian-conversion
The newly added file causes a ton of sparse warnings about the
incorrect use of __le32 and similar types:

drivers/hid/intel-ish-hid/ishtp/loader.h:41:23: error: invalid bitfield specifier for type restricted __le32.
drivers/hid/intel-ish-hid/ishtp/loader.h:42:27: error: invalid bitfield specifier for type restricted __le32.
drivers/hid/intel-ish-hid/ishtp/loader.h:43:24: error: invalid bitfield specifier for type restricted __le32.
drivers/hid/intel-ish-hid/ishtp/loader.h:44:24: error: invalid bitfield specifier for type restricted __le32.
drivers/hid/intel-ish-hid/ishtp/loader.h:45:22: error: invalid bitfield specifier for type restricted __le32.
drivers/hid/intel-ish-hid/ishtp/loader.c:172:33: warning: restricted __le32 degrades to integer
drivers/hid/intel-ish-hid/ishtp/loader.c:178:50: warning: incorrect type in assignment (different base types)
drivers/hid/intel-ish-hid/ishtp/loader.c:178:50:    expected restricted __le32 [usertype] length
drivers/hid/intel-ish-hid/ishtp/loader.c:178:50:    got unsigned long
drivers/hid/intel-ish-hid/ishtp/loader.c:179:50: warning: incorrect type in assignment (different base types)
drivers/hid/intel-ish-hid/ishtp/loader.c:179:50:    expected restricted __le32 [usertype] fw_off
drivers/hid/intel-ish-hid/ishtp/loader.c:179:50:    got unsigned int [usertype] offset
drivers/hid/intel-ish-hid/ishtp/loader.c:180:17: warning: cast from restricted __le32
drivers/hid/intel-ish-hid/ishtp/loader.c:183:24: warning: invalid assignment: +=
drivers/hid/intel-ish-hid/ishtp/loader.c:183:24:    left side has type unsigned int
drivers/hid/intel-ish-hid/ishtp/loader.c:183:24:    right side has type restricted __le32

Add the necessary conversions and use temporary variables where appropriate
to avoid converting back.

Fixes: 579a267e4617 ("HID: intel-ish-hid: Implement loading firmware from host feature")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Zhang Lixu <lixu.zhang@intel.com>
Tested-by: Zhang Lixu <lixu.zhang@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
2024-06-04 16:16:37 +02:00
..
2024-05-18 10:55:13 -07:00
2024-05-14 18:25:53 -07:00
2024-05-19 11:38:15 -07:00
2024-05-16 08:56:49 -07:00
2024-05-14 19:42:24 -07:00
2024-05-17 09:05:46 -07:00
2024-05-16 08:50:32 -07:00
2024-05-15 14:32:27 -07:00
2024-05-17 08:53:47 -07:00
2024-05-14 18:57:22 -07:00
2024-05-20 09:25:10 -07:00
2024-05-14 15:07:07 -07:00
2024-05-14 15:03:19 -07:00
2024-05-18 13:04:15 -07:00
2024-05-20 10:23:39 -07:00
2024-05-17 09:05:46 -07:00
2024-05-18 12:39:20 -07:00
2024-05-14 18:25:53 -07:00
2024-05-18 12:39:20 -07:00
2024-05-16 08:56:49 -07:00
2024-05-16 09:04:52 -07:00
2024-05-20 10:23:39 -07:00
2024-05-13 13:03:54 -07:00
2024-05-08 09:37:58 -07:00
2024-05-15 14:46:43 -07:00
2024-05-14 19:42:24 -07:00
2024-05-14 14:36:09 -07:00
2024-05-14 19:42:24 -07:00
2024-05-14 14:41:01 -07:00
2024-05-14 14:41:01 -07:00
2024-05-14 18:25:53 -07:00
2024-04-29 22:29:44 +02:00
2024-05-14 13:31:24 -07:00
2024-05-19 12:01:00 -07:00
2024-05-14 18:25:53 -07:00
2024-05-14 18:25:53 -07:00
2024-05-20 10:23:39 -07:00
2024-04-29 16:45:53 +02:00