Re: [PATCH v5 1/4] firmware: introduce sysfs driver for QEMU's fw_cfg device

kbuild test robot
2015-11-23T20:14:50Z

[-- Attachment #1: Type: text/plain, Size: 5186 bytes --]

Hi Gabriel,

[auto build test WARNING on v4.4-rc2]
[also build test WARNING on next-20151123]
[cannot apply to robh/for-next]

url: https://github.com/0day-ci/linux/commits/Gabriel-L-Somlo/SysFS-driver-for-QEMU-fw_cfg-device/20151124-000402
config: arm-allyesconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All warnings (new ones prefixed by >>):

drivers/firmware/qemu_fw_cfg.c: In function 'fw_cfg_cmdline_set':
>> drivers/firmware/qemu_fw_cfg.c:510:7: warning: format '%lli' expects argument of type 'long long int *', but argument 3 has type 'phys_addr_t *' [-Wformat=]
&ctrl_off, &data_off, &consumed);
^
>> drivers/firmware/qemu_fw_cfg.c:510:7: warning: format '%lli' expects argument of type 'long long int *', but argument 5 has type 'resource_size_t *' [-Wformat=]
drivers/firmware/qemu_fw_cfg.c:510:7: warning: format '%lli' expects argument of type 'long long int *', but argument 6 has type 'resource_size_t *' [-Wformat=]
drivers/firmware/qemu_fw_cfg.c: In function 'fw_cfg_cmdline_get':
>> drivers/firmware/qemu_fw_cfg.c:563:5: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' [-Wformat=]
fw_cfg_cmdline_dev->resource[0].start);
^
drivers/firmware/qemu_fw_cfg.c:563:5: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' [-Wformat=]
drivers/firmware/qemu_fw_cfg.c:569:5: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t' [-Wformat=]
fw_cfg_cmdline_dev->resource[2].start);
^
drivers/firmware/qemu_fw_cfg.c:569:5: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 5 has type 'resource_size_t' [-Wformat=]
>> drivers/firmware/qemu_fw_cfg.c:569:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'resource_size_t' [-Wformat=]
drivers/firmware/qemu_fw_cfg.c:569:5: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'resource_size_t' [-Wformat=]

vim +510 drivers/firmware/qemu_fw_cfg.c

504 /* consume "<size>" portion of command line argument */
505 size = memparse(arg, &str);
506
507 /* get "@ [:<ctrl_off>:<data_off>]" chunks */
508 processed = sscanf(str, "@%lli%n:%lli:%lli%n",
509 &base, &consumed,
> 510 &ctrl_off, &data_off, &consumed);
511
512 /* sscanf() must process precisely 1 or 3 chunks:
513 * is mandatory, optionally followed by <ctrl_off>
514 * and <data_off>;
515 * there must be no extra characters after the last chunk,
516 * so str[consumed] must be '\0'.
517 */
518 if (str[consumed] ||
519 (processed != 1 && processed != 3))
520 return -EINVAL;
521
522 res[0].start = base;
523 res[0].end = base + size - 1;
524 res[0].flags = !strcmp(kp->name, "mmio") ? IORESOURCE_MEM :
525 IORESOURCE_IO;
526
527 /* insert register offsets, if provided */
528 if (processed > 1) {
529 res[1].name = "ctrl";
530 res[1].start = ctrl_off;
531 res[1].flags = IORESOURCE_REG;
532 res[2].name = "data";
533 res[2].start = data_off;
534 res[2].flags = IORESOURCE_REG;
535 }
536
537 /* "processed" happens to nicely match the number of resources
538 * we need to pass in to this platform device.
539 */
540 fw_cfg_cmdline_dev = platform_device_register_simple("fw_cfg",
541 PLATFORM_DEVID_NONE, res, processed);
542 if (IS_ERR(fw_cfg_cmdline_dev))
543 return PTR_ERR(fw_cfg_cmdline_dev);
544
545 return 0;
546 }
547
548 static int fw_cfg_cmdline_get(char *buf, const struct kernel_param *kp)
549 {
550 /* stay silent if device was not configured via the command
551 * line, or if the parameter name (ioport/mmio) doesn't match
552 * the device setting
553 */
554 if (!fw_cfg_cmdline_dev ||
555 (!strcmp(kp->name, "mmio") ^
556 (fw_cfg_cmdline_dev->resource[0].flags == IORESOURCE_MEM)))
557 return 0;
558
559 switch (fw_cfg_cmdline_dev->num_resources) {
560 case 1:
561 return snprintf(buf, PAGE_SIZE, "0x%llx@0x%llx",
562 resource_size(&fw_cfg_cmdline_dev->resource[0]),
> 563 fw_cfg_cmdline_dev->resource[0].start);
564 case 3:
565 return snprintf(buf, PAGE_SIZE, "0x%llx@0x%llx:%llu:%llu",
566 resource_size(&fw_cfg_cmdline_dev->resource[0]),
567 fw_cfg_cmdline_dev->resource[0].start,
568 fw_cfg_cmdline_dev->resource[1].start,
> 569 fw_cfg_cmdline_dev->resource[2].start);
570 }
571
572 /* Should never get here */

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 53935 bytes --]