[tty:tty-testing 68/80] drivers/tty/serial/8250/8250_pci.c:1823:12: note: in expansion of macro 'do_div'

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

 



tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
head:   7e9e6c1f446cf98e5e59d065f43428a9e1046fed
commit: ad7d1f21825e7513f2fcfe6b8d21f8c365050c34 [68/80] serial: 8250_pci: Add support for Sunix serial boards
config: parisc-c3000_defconfig (attached as .config)
compiler: hppa-linux-gcc (GCC) 7.4.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 ad7d1f21825e7513f2fcfe6b8d21f8c365050c34
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=parisc 

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

All warnings (new ones prefixed by >>):

   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:18,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/tty/serial/8250/8250_pci.c:10:
   drivers/tty/serial/8250/8250_pci.c: In function 'pci_sunix_setup':
   include/asm-generic/div64.h:222:28: warning: comparison of distinct pointer types lacks a cast
     (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \
                               ^
>> drivers/tty/serial/8250/8250_pci.c:1823:12: note: in expansion of macro 'do_div'
      offset = do_div(idx, 4);
               ^~~~~~
   In file included from include/linux/kernel.h:11:0,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/tty/serial/8250/8250_pci.c:10:
   include/asm-generic/div64.h:235:25: warning: right shift count >= width of type [-Wshift-count-overflow]
     } else if (likely(((n) >> 32) == 0)) {  \
                            ^
   include/linux/compiler.h:77:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
>> drivers/tty/serial/8250/8250_pci.c:1823:12: note: in expansion of macro 'do_div'
      offset = do_div(idx, 4);
               ^~~~~~
   In file included from ./arch/parisc/include/generated/asm/div64.h:1:0,
                    from include/linux/kernel.h:18,
                    from include/linux/list.h:9,
                    from include/linux/module.h:9,
                    from drivers/tty/serial/8250/8250_pci.c:10:
   include/asm-generic/div64.h:239:22: error: passing argument 1 of '__div64_32' from incompatible pointer type [-Werror=incompatible-pointer-types]
      __rem = __div64_32(&(n), __base); \
                         ^
>> drivers/tty/serial/8250/8250_pci.c:1823:12: note: in expansion of macro 'do_div'
      offset = do_div(idx, 4);
               ^~~~~~
   include/asm-generic/div64.h:213:17: note: expected 'uint64_t * {aka long long unsigned int *}' but argument is of type 'int *'
    extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
                    ^~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/do_div +1823 drivers/tty/serial/8250/8250_pci.c

  1805	
  1806	static int
  1807	pci_sunix_setup(struct serial_private *priv,
  1808			const struct pciserial_board *board,
  1809			struct uart_8250_port *port, int idx)
  1810	{
  1811		int bar;
  1812		int offset;
  1813	
  1814		port->port.flags |= UPF_FIXED_TYPE;
  1815		port->port.type = PORT_SUNIX;
  1816	
  1817		if (idx < 4) {
  1818			bar = 0;
  1819			offset = idx * board->uart_offset;
  1820		} else {
  1821			bar = 1;
  1822			idx -= 4;
> 1823			offset = do_div(idx, 4);
  1824			offset = idx * 64 + offset * board->uart_offset;
  1825		}
  1826	
  1827		return setup_port(priv, port, bar, offset, 0);
  1828	}
  1829	

---
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]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux