* [linux-next:master 2388/2759] drivers/spi/spi-cadence-quadspi.c:1153:24: warning: comparison of distinct pointer types ('typeof (len) (aka 'unsigned long and 'typeof (500U) (aka 'unsigned int
@ 2021-01-11 16:34 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-01-11 16:34 UTC (permalink / raw)
To: Yanteng Si
Cc: kbuild-all, clang-built-linux, Linux Memory Management List, Mark Brown
[-- Attachment #1: Type: text/plain, Size: 4659 bytes --]
Hi Yanteng,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ef8b014ee4a1ccd9e751732690a8c7cdeed945e7
commit: 8728a81b8f1007426d8f341c5d2400da60f4cea2 [2388/2759] spi: Fix distinct pointer types warning for ARCH=mips
config: arm64-randconfig-r021-20210111 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7be3285248bf54d0784a76174cf44cf7c1e780a5)
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
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=8728a81b8f1007426d8f341c5d2400da60f4cea2
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 8728a81b8f1007426d8f341c5d2400da60f4cea2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/spi/spi-cadence-quadspi.c:1153:24: warning: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned long *') and 'typeof (500U) *' (aka 'unsigned int *')) [-Wcompare-distinct-pointer-types]
msecs_to_jiffies(max(len, 500U)))) {
^~~~~~~~~~~~~~
include/linux/minmax.h:58:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(x, y, >)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/minmax.h:42:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/minmax.h:32:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/minmax.h:18:28: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
1 warning generated.
vim +1153 drivers/spi/spi-cadence-quadspi.c
1106
1107 static int cqspi_direct_read_execute(struct cqspi_flash_pdata *f_pdata,
1108 u_char *buf, loff_t from, size_t len)
1109 {
1110 struct cqspi_st *cqspi = f_pdata->cqspi;
1111 struct device *dev = &cqspi->pdev->dev;
1112 enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
1113 dma_addr_t dma_src = (dma_addr_t)cqspi->mmap_phys_base + from;
1114 int ret = 0;
1115 struct dma_async_tx_descriptor *tx;
1116 dma_cookie_t cookie;
1117 dma_addr_t dma_dst;
1118 struct device *ddev;
1119
1120 if (!cqspi->rx_chan || !virt_addr_valid(buf)) {
1121 memcpy_fromio(buf, cqspi->ahb_base + from, len);
1122 return 0;
1123 }
1124
1125 ddev = cqspi->rx_chan->device->dev;
1126 dma_dst = dma_map_single(ddev, buf, len, DMA_FROM_DEVICE);
1127 if (dma_mapping_error(ddev, dma_dst)) {
1128 dev_err(dev, "dma mapping failed\n");
1129 return -ENOMEM;
1130 }
1131 tx = dmaengine_prep_dma_memcpy(cqspi->rx_chan, dma_dst, dma_src,
1132 len, flags);
1133 if (!tx) {
1134 dev_err(dev, "device_prep_dma_memcpy error\n");
1135 ret = -EIO;
1136 goto err_unmap;
1137 }
1138
1139 tx->callback = cqspi_rx_dma_callback;
1140 tx->callback_param = cqspi;
1141 cookie = tx->tx_submit(tx);
1142 reinit_completion(&cqspi->rx_dma_complete);
1143
1144 ret = dma_submit_error(cookie);
1145 if (ret) {
1146 dev_err(dev, "dma_submit_error %d\n", cookie);
1147 ret = -EIO;
1148 goto err_unmap;
1149 }
1150
1151 dma_async_issue_pending(cqspi->rx_chan);
1152 if (!wait_for_completion_timeout(&cqspi->rx_dma_complete,
> 1153 msecs_to_jiffies(max(len, 500U)))) {
1154 dmaengine_terminate_sync(cqspi->rx_chan);
1155 dev_err(dev, "DMA wait_for_completion_timeout\n");
1156 ret = -ETIMEDOUT;
1157 goto err_unmap;
1158 }
1159
1160 err_unmap:
1161 dma_unmap_single(ddev, dma_dst, len, DMA_FROM_DEVICE);
1162
1163 return ret;
1164 }
1165
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45139 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-11 16:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 16:34 [linux-next:master 2388/2759] drivers/spi/spi-cadence-quadspi.c:1153:24: warning: comparison of distinct pointer types ('typeof (len) (aka 'unsigned long and 'typeof (500U) (aka 'unsigned int kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).