lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 29 Sep 2022 06:31:04 +0800
From:   kernel test robot <lkp@...el.com>
To:     Neil Armstrong <neil.armstrong@...aro.org>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [superna9999:amlogic/v6.1/spicc-screen 5/5]
 drivers/spi/spi-meson-spicc.c:438:2: error: incompatible pointer types
 passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned
 long long *')

tree:   https://github.com/superna9999/linux amlogic/v6.1/spicc-screen
head:   a41ffc262712ee4647b922f38eef57035aa31d4f
commit: a41ffc262712ee4647b922f38eef57035aa31d4f [5/5] spi: meson-spicc: move wait completion in driver to take bursts delay in account
config: hexagon-randconfig-r045-20220926
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/superna9999/linux/commit/a41ffc262712ee4647b922f38eef57035aa31d4f
        git remote add superna9999 https://github.com/superna9999/linux
        git fetch --no-tags superna9999 amlogic/v6.1/spicc-screen
        git checkout a41ffc262712ee4647b922f38eef57035aa31d4f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/spi/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

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

>> drivers/spi/spi-meson-spicc.c:438:2: warning: comparison of distinct pointer types ('typeof ((timeout)) *' (aka 'unsigned long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Wcompare-distinct-pointer-types]
           do_div(timeout, xfer->speed_hz);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div'
           (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
                  ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~
>> drivers/spi/spi-meson-spicc.c:438:2: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
           do_div(timeout, xfer->speed_hz);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
                   __rem = __div64_32(&(n), __base);       \
                                      ^~~~
   include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
   extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
                                        ^
>> drivers/spi/spi-meson-spicc.c:438:2: warning: shift count >= width of type [-Wshift-count-overflow]
           do_div(timeout, xfer->speed_hz);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/div64.h:234:25: note: expanded from macro 'do_div'
           } else if (likely(((n) >> 32) == 0)) {          \
                                  ^  ~~
   include/linux/compiler.h:77:40: note: expanded from macro 'likely'
   # define likely(x)      __builtin_expect(!!(x), 1)
                                               ^
   2 warnings and 1 error generated.


vim +438 drivers/spi/spi-meson-spicc.c

   402	
   403	static int meson_spicc_transfer_one(struct spi_master *master,
   404					    struct spi_device *spi,
   405					    struct spi_transfer *xfer)
   406	{
   407		struct meson_spicc_device *spicc = spi_master_get_devdata(master);
   408		unsigned long timeout;
   409	
   410		/* Store current transfer */
   411		spicc->xfer = xfer;
   412	
   413		/* Setup transfer parameters */
   414		spicc->tx_buf = (u8 *)xfer->tx_buf;
   415		spicc->rx_buf = (u8 *)xfer->rx_buf;
   416		spicc->xfer_remain = xfer->len;
   417	
   418		/* Pre-calculate word size */
   419		spicc->bytes_per_word =
   420		   DIV_ROUND_UP(spicc->xfer->bits_per_word, 8);
   421	
   422		if (xfer->len % spicc->bytes_per_word)
   423			return -EINVAL;
   424	
   425		/* Setup transfer parameters */
   426		meson_spicc_setup_xfer(spicc, xfer);
   427	
   428		meson_spicc_reset_fifo(spicc);
   429	
   430		/* Setup burst */
   431		meson_spicc_setup_burst(spicc);
   432	
   433		/* Setup wait for completion */
   434		reinit_completion(&spicc->done);
   435	
   436		/* For each byte we wait for 8 cycles of the SPI clock */
   437		timeout = 8LL * MSEC_PER_SEC * xfer->len;
 > 438		do_div(timeout, xfer->speed_hz);
   439	
   440		/* Add 10us delay between each fifo bursts */
   441		timeout += ((xfer->len >> 4) * 10) / MSEC_PER_SEC;
   442	
   443		/* Increase it twice and add 200 ms tolerance */
   444		timeout += timeout + 200;
   445	
   446		/* Start burst */
   447		writel_bits_relaxed(SPICC_XCH, SPICC_XCH, spicc->base + SPICC_CONREG);
   448	
   449		/* Enable interrupts */
   450		writel_relaxed(SPICC_TC_EN, spicc->base + SPICC_INTREG);
   451	
   452		if (!wait_for_completion_timeout(&spicc->done, msecs_to_jiffies(timeout)))
   453			return -ETIMEDOUT;
   454	
   455		return 0;
   456	}
   457	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (131683 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ