Re: [PATCH v2 1/4] fw_cfg: add DMA register

From: kbuild test robot
Date: Fri Sep 22 2017 - 07:06:53 EST


Hi Marc-André,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.14-rc1 next-20170922]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/marcandre-lureau-redhat-com/fw_cfg-add-DMA-operations-etc-vmcoreinfo-support/20170922-182716
config: i386-randconfig-x009-201738 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

drivers/firmware/qemu_fw_cfg.c: In function 'fw_cfg_cmdline_set':
>> drivers/firmware/qemu_fw_cfg.c:690:43: error: 'process' undeclared (first use in this function)
(processed != 1 && processed != 3 && process != 4))
^~~~~~~
drivers/firmware/qemu_fw_cfg.c:690:43: note: each undeclared identifier is reported only once for each function it appears in

vim +/process +690 drivers/firmware/qemu_fw_cfg.c

639
640 /* use special scanf/printf modifier for phys_addr_t, resource_size_t */
641 #define PH_ADDR_SCAN_FMT "@%" __PHYS_ADDR_PREFIX "i%n" \
642 ":%" __PHYS_ADDR_PREFIX "i" \
643 ":%" __PHYS_ADDR_PREFIX "i%n" \
644 ":%" __PHYS_ADDR_PREFIX "i%n"
645
646 #define PH_ADDR_PR_1_FMT "0x%" __PHYS_ADDR_PREFIX "x@" \
647 "0x%" __PHYS_ADDR_PREFIX "x"
648
649 #define PH_ADDR_PR_3_FMT PH_ADDR_PR_1_FMT \
650 ":%" __PHYS_ADDR_PREFIX "u" \
651 ":%" __PHYS_ADDR_PREFIX "u"
652
653 #define PH_ADDR_PR_4_FMT PH_ADDR_PR_3_FMT \
654 ":%" __PHYS_ADDR_PREFIX "u"
655
656 static int fw_cfg_cmdline_set(const char *arg, const struct kernel_param *kp)
657 {
658 struct resource res[4] = {};
659 char *str;
660 phys_addr_t base;
661 resource_size_t size, ctrl_off, data_off, dma_off;
662 int processed, consumed = 0;
663
664 /* only one fw_cfg device can exist system-wide, so if one
665 * was processed on the command line already, we might as
666 * well stop here.
667 */
668 if (fw_cfg_cmdline_dev) {
669 /* avoid leaking previously registered device */
670 platform_device_unregister(fw_cfg_cmdline_dev);
671 return -EINVAL;
672 }
673
674 /* consume "<size>" portion of command line argument */
675 size = memparse(arg, &str);
676
677 /* get "@<base>[:<ctrl_off>:<data_off>[:<dma_off>]]" chunks */
678 processed = sscanf(str, PH_ADDR_SCAN_FMT,
679 &base, &consumed,
680 &ctrl_off, &data_off, &consumed,
681 &dma_off, &consumed);
682
683 /* sscanf() must process precisely 1, 3 or 4 chunks:
684 * <base> is mandatory, optionally followed by <ctrl_off>
685 * and <data_off>, and <dma_off>;
686 * there must be no extra characters after the last chunk,
687 * so str[consumed] must be '\0'.
688 */
689 if (str[consumed] ||
> 690 (processed != 1 && processed != 3 && process != 4))
691 return -EINVAL;
692
693 res[0].start = base;
694 res[0].end = base + size - 1;
695 res[0].flags = !strcmp(kp->name, "mmio") ? IORESOURCE_MEM :
696 IORESOURCE_IO;
697
698 /* insert register offsets, if provided */
699 if (processed > 1) {
700 res[1].name = "ctrl";
701 res[1].start = ctrl_off;
702 res[1].flags = IORESOURCE_REG;
703 res[2].name = "data";
704 res[2].start = data_off;
705 res[2].flags = IORESOURCE_REG;
706 }
707 if (processed > 3) {
708 res[3].name = "dma";
709 res[3].start = dma_off;
710 res[3].flags = IORESOURCE_REG;
711 }
712
713 /* "processed" happens to nicely match the number of resources
714 * we need to pass in to this platform device.
715 */
716 fw_cfg_cmdline_dev = platform_device_register_simple("fw_cfg",
717 PLATFORM_DEVID_NONE, res, processed);
718 if (IS_ERR(fw_cfg_cmdline_dev))
719 return PTR_ERR(fw_cfg_cmdline_dev);
720
721 return 0;
722 }
723

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

Attachment: .config.gz
Description: application/gzip