Re: [PATCH v2] HID: pulsar: add driver for Pulsar gaming mice
From: kernel test robot
Date: Sun Apr 12 2026 - 00:54:38 EST
Hi Nikolas,
kernel test robot noticed the following build warnings:
[auto build test WARNING on v7.0-rc7]
[cannot apply to hid/for-next linus/master next-20260410]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Nikolas-Koesling/HID-pulsar-add-driver-for-Pulsar-gaming-mice/20260411-084544
base: v7.0-rc7
patch link: https://lore.kernel.org/r/20260401185708.286359-1-nikolas%40koesling.info
patch subject: [PATCH v2] HID: pulsar: add driver for Pulsar gaming mice
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20260412/202604121253.ZYbxnPmo-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260412/202604121253.ZYbxnPmo-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/202604121253.ZYbxnPmo-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
drivers/hid/hid-pulsar.c: In function 'pulsar_init_work':
>> drivers/hid/hid-pulsar.c:601:27: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 32 [-Wformat-truncation=]
601 | "%s", hdev->name);
| ^~
drivers/hid/hid-pulsar.c:600:17: note: 'snprintf' output between 1 and 128 bytes into a destination of size 32
600 | snprintf(drvdata->battery.model, sizeof(drvdata->battery.model),
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
601 | "%s", hdev->name);
| ~~~~~~~~~~~~~~~~~
drivers/hid/hid-pulsar.c:586:59: warning: '%s' directive output may be truncated writing up to 127 bytes into a region of size 32 [-Wformat-truncation=]
586 | sizeof(drvdata->battery.model), "%s", hdev->name);
| ^~
drivers/hid/hid-pulsar.c:585:17: note: 'snprintf' output between 1 and 128 bytes into a destination of size 32
585 | snprintf(drvdata->battery.model,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
586 | sizeof(drvdata->battery.model), "%s", hdev->name);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +601 drivers/hid/hid-pulsar.c
553
554 static void pulsar_init_work(struct work_struct *work)
555 {
556 struct pulsar_data *drvdata;
557 struct hid_device *hdev;
558 struct power_supply_config psy_cfg;
559 int ret;
560 u8 data[DEV_INFO_LEN];
561
562 drvdata = container_of(work, struct pulsar_data, init_work.work);
563 hdev = drvdata->hdev;
564
565 ret = read_device_info(drvdata, data);
566 if (ret == -ETIMEDOUT) {
567 if (drvdata->init_retries--) {
568 hid_dbg(hdev,
569 "device info read timed out, retrying (%u left)\n",
570 drvdata->init_retries);
571 schedule_delayed_work(&drvdata->init_work,
572 msecs_to_jiffies
573 (INIT_DELAY_MSEC));
574 return;
575 }
576 hid_err(hdev, "device info read timed out, giving up\n");
577 return;
578 }
579 if (ret < 0) {
580 if (drvdata->type == TYPE_PULSAR) {
581 hid_err(hdev, "failed to read device info: %d\n", ret);
582 return;
583 }
584 hid_dbg(hdev, "failed to read device info: %d\n", ret);
585 snprintf(drvdata->battery.model,
586 sizeof(drvdata->battery.model), "%s", hdev->name);
587 goto register_battery;
588 }
589
590 hid_dbg(hdev, "device info: %*ph (%d)\n", DEV_INFO_LEN, data, ret);
591
592 switch (drvdata->type) {
593 case TYPE_PULSAR:
594 model_pulsar(data, drvdata);
595 break;
596 case TYPE_ATK:
597 model_atk(data, drvdata);
598 break;
599 default:
600 snprintf(drvdata->battery.model, sizeof(drvdata->battery.model),
> 601 "%s", hdev->name);
602 }
603
604 register_battery:
605 init_power_supply_desc(drvdata);
606
607 psy_cfg = (struct power_supply_config) {.drv_data = drvdata };
608 drvdata->battery.ps =
609 devm_power_supply_register(&hdev->dev, &drvdata->battery.desc,
610 &psy_cfg);
611 if (IS_ERR(drvdata->battery.ps)) {
612 hid_err(hdev, "failed to register battery: %ld\n",
613 PTR_ERR(drvdata->battery.ps));
614 drvdata->battery.ps = NULL;
615 return;
616 }
617
618 atomic_set(&drvdata->device_verified, 1);
619 hid_info(hdev, "device verified, battery registered\n");
620 }
621
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki