From: kernel test robot <lkp@intel.com>
To: Benjamin Tissoires <bentiss@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 8744/9027] drivers/hid/bpf/hid_bpf_dispatch.c:363:47: warning: cast from pointer to integer of different size
Date: Fri, 28 Jun 2024 23:06:32 +0800 [thread overview]
Message-ID: <202406282304.UydSVncq-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 642a16ca7994a50d7de85715996a8ce171a5bdfb
commit: 67eccf151d76a9939ad8a50c6db5cb486b01df24 [8744/9027] HID: add source argument to HID low level functions
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240628/202406282304.UydSVncq-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240628/202406282304.UydSVncq-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406282304.UydSVncq-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/hid/bpf/hid_bpf_dispatch.c: In function 'hid_bpf_hw_request':
>> drivers/hid/bpf/hid_bpf_dispatch.c:363:47: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
363 | (__u64)ctx);
| ^
drivers/hid/bpf/hid_bpf_dispatch.c: In function 'hid_bpf_hw_output_report':
drivers/hid/bpf/hid_bpf_dispatch.c:403:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
403 | (__u64)ctx);
| ^
drivers/hid/bpf/hid_bpf_dispatch.c: In function 'hid_bpf_input_report':
drivers/hid/bpf/hid_bpf_dispatch.c:434:68: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
434 | return hid_ops->hid_input_report(hdev, type, buf, size, 0, (__u64)ctx);
| ^
vim +363 drivers/hid/bpf/hid_bpf_dispatch.c
313
314 /**
315 * hid_bpf_hw_request - Communicate with a HID device
316 *
317 * @ctx: the HID-BPF context previously allocated in hid_bpf_allocate_context()
318 * @buf: a %PTR_TO_MEM buffer
319 * @buf__sz: the size of the data to transfer
320 * @rtype: the type of the report (%HID_INPUT_REPORT, %HID_FEATURE_REPORT, %HID_OUTPUT_REPORT)
321 * @reqtype: the type of the request (%HID_REQ_GET_REPORT, %HID_REQ_SET_REPORT, ...)
322 *
323 * @returns %0 on success, a negative error code otherwise.
324 */
325 __bpf_kfunc int
326 hid_bpf_hw_request(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz,
327 enum hid_report_type rtype, enum hid_class_request reqtype)
328 {
329 struct hid_device *hdev;
330 size_t size = buf__sz;
331 u8 *dma_data;
332 int ret;
333
334 /* check arguments */
335 ret = __hid_bpf_hw_check_params(ctx, buf, &size, rtype);
336 if (ret)
337 return ret;
338
339 switch (reqtype) {
340 case HID_REQ_GET_REPORT:
341 case HID_REQ_GET_IDLE:
342 case HID_REQ_GET_PROTOCOL:
343 case HID_REQ_SET_REPORT:
344 case HID_REQ_SET_IDLE:
345 case HID_REQ_SET_PROTOCOL:
346 break;
347 default:
348 return -EINVAL;
349 }
350
351 hdev = (struct hid_device *)ctx->hid; /* discard const */
352
353 dma_data = kmemdup(buf, size, GFP_KERNEL);
354 if (!dma_data)
355 return -ENOMEM;
356
357 ret = hid_ops->hid_hw_raw_request(hdev,
358 dma_data[0],
359 dma_data,
360 size,
361 rtype,
362 reqtype,
> 363 (__u64)ctx);
364
365 if (ret > 0)
366 memcpy(buf, dma_data, ret);
367
368 kfree(dma_data);
369 return ret;
370 }
371
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-28 15:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202406282304.UydSVncq-lkp@intel.com \
--to=lkp@intel.com \
--cc=bentiss@kernel.org \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox