summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2022-10-05 10:37:17 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2022-10-05 10:37:17 +0100
commit1145c3d5e7028e95741fb86693ddce00202decf6 (patch)
tree3fe7e568dbf765ea0fe91c1db16d9fbe289995dc /drivers/hid
parent1af52d6b35bb7faaabb1f0b34fbcae7c619e54e7 (diff)
parent486da113c698a748bd8d75a0d10a2eee8ef8d416 (diff)
Merge branch 'for-6.1/rmi' into for-linus
- compilation warning fix (Jiangshan Yi)
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-rmi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index 311eee599ce9..bb1f423f4ace 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -237,8 +237,7 @@ static int rmi_hid_read_block(struct rmi_transport_dev *xport, u16 addr,
read_input_count = data->readReport[1];
memcpy(buf + bytes_read, &data->readReport[2],
- read_input_count < bytes_needed ?
- read_input_count : bytes_needed);
+ min(read_input_count, bytes_needed));
bytes_read += read_input_count;
bytes_needed -= read_input_count;
@@ -347,8 +346,7 @@ static int rmi_read_data_event(struct hid_device *hdev, u8 *data, int size)
return 0;
}
- memcpy(hdata->readReport, data, size < hdata->input_report_size ?
- size : hdata->input_report_size);
+ memcpy(hdata->readReport, data, min((u32)size, hdata->input_report_size));
set_bit(RMI_READ_DATA_PENDING, &hdata->flags);
wake_up(&hdata->wait);