All of lore.kernel.org
 help / color / mirror / Atom feed
* [nvdimm:libnvdimm-pending 5/29] drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
@ 2020-02-13 22:58 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-02-13 22:58 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm.git libnvdimm-pending
head:   7bd03e293d7f5a46742f26b625ece4d5adb21c66
commit: 162072c175d46796370c6d22017dd1ccba46240a [5/29] libnvdimm/region: Introduce an 'align' attribute
config: arc-randconfig-a001-20200214 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 162072c175d46796370c6d22017dd1ccba46240a
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers/nvdimm/region_devs.c:5:
   drivers/nvdimm/region_devs.c: In function 'align_store':
   include/asm-generic/div64.h:226:28: warning: comparison of distinct pointer types lacks a cast
     226 |  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
         |                            ^~
>> drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   In file included from include/linux/string.h:6,
                    from include/linux/scatterlist.h:5,
                    from drivers/nvdimm/region_devs.c:5:
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
      33 |    ______r = __builtin_expect(!!(x), expect); \
         |                                  ^
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
>> drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
      35 |           expect, is_constant); \
         |                   ^~~~~~~~~~~
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
>> drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers/nvdimm/region_devs.c:5:
>> include/asm-generic/div64.h:243:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
     243 |   __rem = __div64_32(&(n), __base); \
         |                      ^~~~
         |                      |
         |                      long unsigned int *
>> drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:217:38: note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
     217 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
         |                            ~~~~~~~~~~^~~~~~~~
   drivers/nvdimm/region_devs.c: In function 'default_align':
   include/asm-generic/div64.h:226:28: warning: comparison of distinct pointer types lacks a cast
     226 |  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
         |                            ^~
   drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   In file included from include/linux/string.h:6,
                    from include/linux/scatterlist.h:5,
                    from drivers/nvdimm/region_devs.c:5:
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
      33 |    ______r = __builtin_expect(!!(x), expect); \
         |                                  ^
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
      35 |           expect, is_constant); \
         |                   ^~~~~~~~~~~
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers/nvdimm/region_devs.c:5:
>> include/asm-generic/div64.h:243:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
     243 |   __rem = __div64_32(&(n), __base); \
         |                      ^~~~
         |                      |
         |                      long unsigned int *
   drivers/nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:217:38: note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
     217 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
         |                            ~~~~~~~~~~^~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers//nvdimm/region_devs.c:5:
   drivers//nvdimm/region_devs.c: In function 'align_store':
   include/asm-generic/div64.h:226:28: warning: comparison of distinct pointer types lacks a cast
     226 |  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
         |                            ^~
   drivers//nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   In file included from include/linux/string.h:6,
                    from include/linux/scatterlist.h:5,
                    from drivers//nvdimm/region_devs.c:5:
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
      33 |    ______r = __builtin_expect(!!(x), expect); \
         |                                  ^
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers//nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
      35 |           expect, is_constant); \
         |                   ^~~~~~~~~~~
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers//nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers//nvdimm/region_devs.c:5:
>> include/asm-generic/div64.h:243:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
     243 |   __rem = __div64_32(&(n), __base); \
         |                      ^~~~
         |                      |
         |                      long unsigned int *
   drivers//nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div'
     567 |  remainder = do_div(dpa, nd_region->ndr_mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:217:38: note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
     217 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
         |                            ~~~~~~~~~~^~~~~~~~
   drivers//nvdimm/region_devs.c: In function 'default_align':
   include/asm-generic/div64.h:226:28: warning: comparison of distinct pointer types lacks a cast
     226 |  (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
         |                            ^~
   drivers//nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   In file included from include/linux/string.h:6,
                    from include/linux/scatterlist.h:5,
                    from drivers//nvdimm/region_devs.c:5:
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'
      33 |    ______r = __builtin_expect(!!(x), expect); \
         |                                  ^
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers//nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:239:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |                         ^~
   include/linux/compiler.h:35:19: note: in definition of macro '__branch_check__'
      35 |           expect, is_constant); \
         |                   ^~~~~~~~~~~
   include/asm-generic/div64.h:239:13: note: in expansion of macro 'likely'
     239 |  } else if (likely(((n) >> 32) == 0)) {  \
         |             ^~~~~~
   drivers//nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   In file included from ./arch/arc/include/generated/asm/div64.h:1,
                    from include/linux/kernel.h:18,
                    from include/asm-generic/bug.h:19,
                    from arch/arc/include/asm/bug.h:29,
                    from include/linux/bug.h:5,
                    from include/linux/scatterlist.h:7,
                    from drivers//nvdimm/region_devs.c:5:
>> include/asm-generic/div64.h:243:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
     243 |   __rem = __div64_32(&(n), __base); \
         |                      ^~~~
         |                      |
         |                      long unsigned int *
   drivers//nvdimm/region_devs.c:1034:14: note: in expansion of macro 'do_div'
    1034 |  remainder = do_div(per_mapping, mappings);
         |              ^~~~~~
   include/asm-generic/div64.h:217:38: note: expected 'uint64_t *' {aka 'long long unsigned int *'} but argument is of type 'long unsigned int *'
     217 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
         |                            ~~~~~~~~~~^~~~~~~~
   cc1: some warnings being treated as errors

vim +/do_div +567 drivers/nvdimm/region_devs.c

   543	
   544	static ssize_t align_store(struct device *dev,
   545			struct device_attribute *attr, const char *buf, size_t len)
   546	{
   547		struct nd_region *nd_region = to_nd_region(dev);
   548		unsigned long val, dpa;
   549		u32 remainder;
   550		int rc;
   551	
   552		rc = kstrtoul(buf, 0, &val);
   553		if (rc)
   554			return rc;
   555	
   556		if (!nd_region->ndr_mappings)
   557			return -ENXIO;
   558	
   559		/*
   560		 * Ensure space-align is evenly divisible by the region
   561		 * interleave-width because the kernel typically has no facility
   562		 * to determine which DIMM(s), dimm-physical-addresses, would
   563		 * contribute to the tail capacity in system-physical-address
   564		 * space for the namespace.
   565		 */
   566		dpa = val;
 > 567		remainder = do_div(dpa, nd_region->ndr_mappings);
   568		if (!is_power_of_2(dpa) || dpa < PAGE_SIZE
   569				|| val > region_size(nd_region) || remainder)
   570			return -EINVAL;
   571	
   572		/*
   573		 * Given that space allocation consults this value multiple
   574		 * times ensure it does not change for the duration of the
   575		 * allocation.
   576		 */
   577		nvdimm_bus_lock(dev);
   578		nd_region->align = val;
   579		nvdimm_bus_unlock(dev);
   580	
   581		return len;
   582	}
   583	static DEVICE_ATTR_RW(align);
   584	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23947 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-13 22:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-13 22:58 [nvdimm:libnvdimm-pending 5/29] drivers/nvdimm/region_devs.c:567:14: note: in expansion of macro 'do_div' kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.