linux-next: build failure after merge of the hid tree

From: Stephen Rothwell
Date: Mon Jul 01 2024 - 04:56:08 EST


Hi all,

After merging the hid tree, today's linux-next build (i386 defconfig)
failed like this:

drivers/hid/hidraw.c: In function 'hidraw_send_report':
drivers/hid/hidraw.c:143:63: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
143 | ret = __hid_hw_output_report(dev, buf, count, (__u64)file, false);
| ^
drivers/hid/hidraw.c:154:56: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
154 | HID_REQ_SET_REPORT, (__u64)file, false);
| ^
drivers/hid/hidraw.c: In function 'hidraw_get_report':
drivers/hid/hidraw.c:231:56: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
231 | HID_REQ_GET_REPORT, (__u64)file, false);
| ^
cc1: all warnings being treated as errors

Caused by commit

67eccf151d76 ("HID: add source argument to HID low level functions")

I applied the following patch.

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Mon, 1 Jul 2024 18:36:36 +1000
Subject: [PATCH] fix up for "HID: add source argument to HID low level
functions"

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
drivers/hid/hidraw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index c2396916cdaa..34633f99f3e4 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -140,7 +140,7 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer,

if ((report_type == HID_OUTPUT_REPORT) &&
!(dev->quirks & HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP)) {
- ret = __hid_hw_output_report(dev, buf, count, (__u64)file, false);
+ ret = __hid_hw_output_report(dev, buf, count, (unsigned long)file, false);
/*
* compatibility with old implementation of USB-HID and I2C-HID:
* if the device does not support receiving output reports,
@@ -151,7 +151,7 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer,
}

ret = __hid_hw_raw_request(dev, buf[0], buf, count, report_type,
- HID_REQ_SET_REPORT, (__u64)file, false);
+ HID_REQ_SET_REPORT, (unsigned long)file, false);

out_free:
kfree(buf);
@@ -228,7 +228,7 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
}

ret = __hid_hw_raw_request(dev, report_number, buf, count, report_type,
- HID_REQ_GET_REPORT, (__u64)file, false);
+ HID_REQ_GET_REPORT, (unsigned long)file, false);

if (ret < 0)
goto out_free;
--
2.43.0

--
Cheers,
Stephen Rothwell

Attachment: pgpygaiFr_7Mk.pgp
Description: OpenPGP digital signature