[vkoul-dmaengine:next 6/11] drivers/dma/apple-admac.c:210:34: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long'

From: kernel test robot
Date: Sat Jun 11 2022 - 06:43:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
head: c9357195c5770029f0c65a5b76756dea5b767ff0
commit: b127315d9a78c011c011b88b92f650510edcfbd2 [6/11] dmaengine: apple-admac: Add Apple ADMAC driver
config: riscv-randconfig-r035-20220611 (https://download.01.org/0day-ci/archive/20220611/202206111824.f7xWW0VG-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ff4abe755279a3a47cc416ef80dbc900d9a98a19)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git/commit/?id=b127315d9a78c011c011b88b92f650510edcfbd2
git remote add vkoul-dmaengine https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git
git fetch --no-tags vkoul-dmaengine next
git checkout b127315d9a78c011c011b88b92f650510edcfbd2
# 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=riscv SHELL=/bin/bash drivers/dma/

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

All warnings (new ones prefixed by >>):

>> drivers/dma/apple-admac.c:210:34: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
channo, &addr, tx->period_len, FLAG_DESC_NOTIFY);
^~~~~~~~~~~~~~~~
include/linux/dev_printk.h:155:39: note: expanded from macro 'dev_dbg'
dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dynamic_debug.h:167:19: note: expanded from macro 'dynamic_dev_dbg'
dev, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dynamic_debug.h:152:56: note: expanded from macro '_dynamic_func_call'
__dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
^~~~~~~~~~~
include/linux/dynamic_debug.h:134:15: note: expanded from macro '__dynamic_func_call'
func(&id, ##__VA_ARGS__); \
^~~~~~~~~~~
drivers/dma/apple-admac.c:32:26: note: expanded from macro 'FLAG_DESC_NOTIFY'
#define FLAG_DESC_NOTIFY BIT(16)
^~~~~~~
include/vdso/bits.h:7:19: note: expanded from macro 'BIT'
#define BIT(nr) (UL(1) << (nr))
^~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:213:22: warning: shift count >= width of type [-Wshift-count-overflow]
writel_relaxed(addr >> 32, ad->base + REG_DESC_WRITE(channo));
^ ~~
arch/riscv/include/asm/mmio.h:120:57: note: expanded from macro 'writel_relaxed'
#define writel_relaxed(v, c) ({ __io_rbw(); writel_cpu((v), (c)); __io_raw(); })
^
arch/riscv/include/asm/mmio.h:93:71: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__cpu_to_le32'
#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
^
2 warnings generated.


vim +210 drivers/dma/apple-admac.c

195
196 /*
197 * Write one hardware descriptor for a dmaengine cyclic transaction.
198 */
199 static void admac_cyclic_write_one_desc(struct admac_data *ad, int channo,
200 struct admac_tx *tx)
201 {
202 dma_addr_t addr;
203
204 addr = tx->buf_addr + (tx->submitted_pos % tx->buf_len);
205
206 /* If happens means we have buggy code */
207 WARN_ON_ONCE(addr + tx->period_len > tx->buf_end);
208
209 dev_dbg(ad->dev, "ch%d descriptor: addr=0x%pad len=0x%zx flags=0x%x\n",
> 210 channo, &addr, tx->period_len, FLAG_DESC_NOTIFY);
211
212 writel_relaxed(addr, ad->base + REG_DESC_WRITE(channo));
> 213 writel_relaxed(addr >> 32, ad->base + REG_DESC_WRITE(channo));
214 writel_relaxed(tx->period_len, ad->base + REG_DESC_WRITE(channo));
215 writel_relaxed(FLAG_DESC_NOTIFY, ad->base + REG_DESC_WRITE(channo));
216
217 tx->submitted_pos += tx->period_len;
218 tx->submitted_pos %= 2 * tx->buf_len;
219 }
220

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