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

2017-09-22 Thread kbuild test robot
Hi Marc-André,

[auto build test WARNING on linus/master]
[also build test WARNING 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-x075-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 warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers//firmware/qemu_fw_cfg.c:30:
   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))
  ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^~~~
>> drivers//firmware/qemu_fw_cfg.c:689:2: note: in expansion of macro 'if'
 if (str[consumed] ||
 ^~
   drivers//firmware/qemu_fw_cfg.c:690:43: note: each undeclared identifier is 
reported only once for each function it appears in
 (processed != 1 && processed != 3 && process != 4))
  ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^~~~
>> drivers//firmware/qemu_fw_cfg.c:689:2: note: in expansion of macro 'if'
 if (str[consumed] ||
 ^~

vim +/if +689 drivers//firmware/qemu_fw_cfg.c

75f3e8e4 Gabriel Somlo 2016-01-28  639  
75f3e8e4 Gabriel Somlo 2016-01-28  640  /* use special scanf/printf 
modifier for phys_addr_t, resource_size_t */
75f3e8e4 Gabriel Somlo 2016-01-28  641  #define PH_ADDR_SCAN_FMT "@%" 
__PHYS_ADDR_PREFIX "i%n" \
75f3e8e4 Gabriel Somlo 2016-01-28  642   ":%" 
__PHYS_ADDR_PREFIX "i" \
46ebd6f8 Marc-André Lureau 2017-09-19  643   ":%" 
__PHYS_ADDR_PREFIX "i%n" \
75f3e8e4 Gabriel Somlo 2016-01-28  644   ":%" 
__PHYS_ADDR_PREFIX "i%n"
75f3e8e4 Gabriel Somlo 2016-01-28  645  
75f3e8e4 Gabriel Somlo 2016-01-28  646  #define PH_ADDR_PR_1_FMT "0x%" 
__PHYS_ADDR_PREFIX "x@" \
75f3e8e4 Gabriel Somlo 2016-01-28  647   "0x%" 
__PHYS_ADDR_PREFIX "x"
75f3e8e4 Gabriel Somlo 2016-01-28  648  
75f3e8e4 Gabriel Somlo 2016-01-28  649  #define PH_ADDR_PR_3_FMT 
PH_ADDR_PR_1_FMT \
75f3e8e4 Gabriel Somlo 2016-01-28  650   ":%" 
__PHYS_ADDR_PREFIX "u" \
75f3e8e4 Gabriel Somlo 2016-01-28  651   ":%" 
__PHYS_ADDR_PREFIX "u"
75f3e8e4 Gabriel Somlo 2016-01-28  652  
46ebd6f8 Marc-André Lureau 2017-09-19  653  #define PH_ADDR_PR_4_FMT 
PH_ADDR_PR_3_FMT \
46ebd6f8 Marc-André Lureau 2017-09-19  654   ":%" 
__PHYS_ADDR_PREFIX "u"
46ebd6f8 Marc-André Lureau 2017-09-19  655  
75f3e8e4 Gabriel Somlo 2016-01-28  656  static int fw_cfg_cmdline_set(const 
char *arg, const struct kernel_param *kp)
75f3e8e4 Gabriel Somlo 2016-01-28  657  {
46ebd6f8 Marc-André Lureau 2017-09-19  658  struct resource res[4] = {};
75f3e8e4 Gabriel Somlo 2016-01-28  659  char *str;
75f3e8e4 Gabriel Somlo 2016-01-28  660  phys_addr_t base;
46ebd6f8 Marc-André Lureau 2017-09-19  661  resource_size_t size, ctrl_off, 
data_off, dma_off;
75f3e8e4 Gabriel Somlo 2016-01-28  662  int processed, consumed = 0;
75f3e8e4 Gabriel Somlo 2016-01-28  663  
75f3e8e4 Gabriel Somlo 2016-01-28  664  /* only one fw_cfg device can 
exist system-wide, so if one
75f3e8e4 Gabriel Somlo 2016-01-28  665   * was processed on the command 
line already, we might as
75f3e8e4 Gabriel Somlo 2016-01-28  666   * well stop here.
75f3e8e4 Gabriel Somlo 2016-01-28  667   */
75f3e8e4 Gabriel Somlo 2016-01-28  668  if (fw_cfg_cmdline_dev) {
75f3e8e4 Gabriel Somlo 2016-01-28  669  /* avoid leaking 
previously registered device */
75f3e8e4 Gabriel Somlo 2016-01-28  670  
platform_device_unregister(fw_cfg_cmdline_dev);
75f3e8e4 Gabriel Somlo 2016-01-28  671  return -EINVAL;
75f3e8e4 Gabriel Somlo 2016-01-28  672  }
75f3e8e4 Gabriel Somlo 2016-01-28  673  
75f3e8e4 Gabriel Somlo 2016-01-28  674  /* consume "" 

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

2017-09-22 Thread kbuild test robot
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 "" portion of command line argument */
   675  size = memparse(arg, );
   676  
   677  /* get "@[::[:]]" chunks */
   678  processed = sscanf(str, PH_ADDR_SCAN_FMT,
   679 , ,
   680 _off, _off, ,
   681 _off, );
   682  
   683  /* sscanf() must process precisely 1, 3 or 4 chunks:
   684   *  is mandatory, optionally followed by 
   685   * and , and ;
   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 infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz