[hid:for-6.12/bpf 6/15] drivers/hid/hid-core.c:2689:52: error: passing 'const __u8 *' (aka 'const unsigned char *') to parameter of type 'u8 *' (aka 'unsigned char *') discards qualifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-6.12/bpf
head:   d46a60c7a795ef0a115e27235b88dcecc78b8c26
commit: f10a11b7b599467153f679d35ed4712bbbec918f [6/15] HID: bpf: move HID-BPF report descriptor fixup earlier
config: arm-jornada720_defconfig (https://download.01.org/0day-ci/archive/20240914/202409140413.DizXFslQ-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project bf684034844c660b778f0eba103582f582b710c9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240914/202409140413.DizXFslQ-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409140413.DizXFslQ-lkp@xxxxxxxxx/

Note: the hid/for-6.12/bpf HEAD d46a60c7a795ef0a115e27235b88dcecc78b8c26 builds fine.
      It only hurts bisectability.

All errors (new ones prefixed by >>):

   In file included from drivers/hid/hid-core.c:21:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     517 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> drivers/hid/hid-core.c:2689:52: error: passing 'const __u8 *' (aka 'const unsigned char *') to parameter of type 'u8 *' (aka 'unsigned char *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    2689 |                 hdev->bpf_rdesc = call_hid_bpf_rdesc_fixup(hdev, hdev->dev_rdesc,
         |                                                                  ^~~~~~~~~~~~~~~
   include/linux/hid_bpf.h:231:73: note: passing argument to parameter 'rdesc' here
     231 | static inline u8 *call_hid_bpf_rdesc_fixup(struct hid_device *hdev, u8 *rdesc,
         |                                                                         ^
   1 warning and 1 error generated.


vim +2689 drivers/hid/hid-core.c

  2681	
  2682	static int __hid_device_probe(struct hid_device *hdev, struct hid_driver *hdrv)
  2683	{
  2684		const struct hid_device_id *id;
  2685		int ret;
  2686	
  2687		if (!hdev->bpf_rsize) {
  2688			hdev->bpf_rsize = hdev->dev_rsize;
> 2689			hdev->bpf_rdesc = call_hid_bpf_rdesc_fixup(hdev, hdev->dev_rdesc,
  2690								   &hdev->bpf_rsize);
  2691		}
  2692	
  2693		if (!hid_check_device_match(hdev, hdrv, &id))
  2694			return -ENODEV;
  2695	
  2696		hdev->devres_group_id = devres_open_group(&hdev->dev, NULL, GFP_KERNEL);
  2697		if (!hdev->devres_group_id)
  2698			return -ENOMEM;
  2699	
  2700		/* reset the quirks that has been previously set */
  2701		hdev->quirks = hid_lookup_quirk(hdev);
  2702		hdev->driver = hdrv;
  2703	
  2704		if (hdrv->probe) {
  2705			ret = hdrv->probe(hdev, id);
  2706		} else { /* default probe */
  2707			ret = hid_open_report(hdev);
  2708			if (!ret)
  2709				ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
  2710		}
  2711	
  2712		/*
  2713		 * Note that we are not closing the devres group opened above so
  2714		 * even resources that were attached to the device after probe is
  2715		 * run are released when hid_device_remove() is executed. This is
  2716		 * needed as some drivers would allocate additional resources,
  2717		 * for example when updating firmware.
  2718		 */
  2719	
  2720		if (ret) {
  2721			devres_release_group(&hdev->dev, hdev->devres_group_id);
  2722			hid_close_report(hdev);
  2723			hdev->driver = NULL;
  2724		}
  2725	
  2726		return ret;
  2727	}
  2728	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux