Re: [PATCH v11 1/9] LIB: Introduce a generic PIO mapping method

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

 




Hi Zhichang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.15-rc8 next-20180119]
[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/John-Garry/LPC-legacy-ISA-I-O-support/20180121-194832
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:21,
                    from lib/logic_pio.c:19:
   lib/logic_pio.c: In function 'logic_pio_trans_hwaddr':
   include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:301:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
>> lib/logic_pio.c:175:3: note: in expansion of macro 'pr_err'
      pr_err("resource size 0x%llx cannot fit in IO range size 0x%llx\n",
      ^~~~~~
   lib/logic_pio.c:175:30: note: format string is defined here
      pr_err("resource size 0x%llx cannot fit in IO range size 0x%llx\n",
                              ~~~^
                              %x
   In file included from include/linux/printk.h:7:0,
                    from include/linux/kernel.h:14,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:21,
                    from lib/logic_pio.c:19:
   include/linux/kern_levels.h:5:18: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:301:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
>> lib/logic_pio.c:175:3: note: in expansion of macro 'pr_err'
      pr_err("resource size 0x%llx cannot fit in IO range size 0x%llx\n",
      ^~~~~~
   lib/logic_pio.c:175:65: note: format string is defined here
      pr_err("resource size 0x%llx cannot fit in IO range size 0x%llx\n",
                                                                 ~~~^
                                                                 %x

vim +/pr_err +175 lib/logic_pio.c

   157	
   158	/*
   159	 * This function is generic for translating a hardware address to logical PIO.
   160	 * @hw_addr: the hardware address of host, can be CPU address or host-local
   161	 *		address;
   162	 */
   163	unsigned long
   164	logic_pio_trans_hwaddr(struct fwnode_handle *fwnode, resource_size_t addr,
   165			       resource_size_t size)
   166	{
   167		struct logic_pio_hwaddr *range;
   168	
   169		range = find_io_range_by_fwnode(fwnode);
   170		if (!range || range->flags == PIO_CPU_MMIO) {
   171			pr_err("range not found or invalid\n");
   172			return -1;
   173		}
   174		if (range->size < size) {
 > 175			pr_err("resource size 0x%llx cannot fit in IO range size 0x%llx\n",
   176			       size, range->size);
   177			return -1;
   178		}
   179		return addr - range->hw_start + range->io_start;
   180	}
   181	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux