Commit e91fc483 authored by Matt Ranostay's avatar Matt Ranostay Committed by Jiri Kosina

HID: mcp2221: fix 'cast to restricted __le16' sparse warnings

Use (__force __le16) cast for adc_values le16_to_cpu conversion to correct following sparse
warnings:

drivers/hid/hid-mcp2221.c:950:32: sparse: sparse: cast to restricted __le16
Reported-by: default avatarkernel test robot <lkp@intel.com>
Fixes: 960f9df7 ("HID: mcp2221: add ADC/DAC support via iio subsystem")
Signed-off-by: default avatarMatt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent daf405c8
......@@ -950,7 +950,7 @@ static int mcp2221_read_raw(struct iio_dev *indio_dev,
ret = mcp_chk_last_cmd_status(mcp);
if (!ret) {
*val = le16_to_cpu(mcp->adc_values[channel->address]);
*val = le16_to_cpu((__force __le16) mcp->adc_values[channel->address]);
if (*val >= BIT(10))
ret = -EINVAL;
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment