[asahilinux:bits/070-audio 2/20] drivers/dma/apple-admac.c:260:5: warning: no previous prototype for function 'admac_cyclic_read_residue'

From: kernel test robot
Date: Wed May 25 2022 - 04:35:57 EST


tree: https://github.com/AsahiLinux/linux bits/070-audio
head: 401ef594286e6abfe89c2d92664087bc5d6ca657
commit: d2b3a34a7f529cd3e338989d7b4c71981180ad30 [2/20] dmaengine: apple-admac: Add Apple ADMAC driver
config: arm64-buildonly-randconfig-r005-20220524 (https://download.01.org/0day-ci/archive/20220525/202205251600.AqjYQGzD-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d52a6e75b0c402c7f3b42a2b1b2873f151220947)
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://github.com/AsahiLinux/linux/commit/d2b3a34a7f529cd3e338989d7b4c71981180ad30
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux bits/070-audio
git checkout d2b3a34a7f529cd3e338989d7b4c71981180ad30
# 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=arm64 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:260:5: warning: no previous prototype for function 'admac_cyclic_read_residue' [-Wmissing-prototypes]
u32 admac_cyclic_read_residue(struct admac_data *ad, int channo, struct admac_tx *adtx)
^
drivers/dma/apple-admac.c:260:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 admac_cyclic_read_residue(struct admac_data *ad, int channo, struct admac_tx *adtx)
^
static
1 warning generated.


vim +/admac_cyclic_read_residue +260 drivers/dma/apple-admac.c

256
257 /*
258 * Read from hardware the residue of a cyclic dmaengine transaction.
259 */
> 260 u32 admac_cyclic_read_residue(struct admac_data *ad, int channo, struct admac_tx *adtx)
261 {
262 u32 ring1, ring2;
263 u32 residue1, residue2;
264 int nreports;
265 size_t pos;
266
267 ring1 = admac_peek(ad, REG_REPORT_RING(channo));
268 residue1 = admac_peek(ad, REG_RESIDUE(channo));
269 ring2 = admac_peek(ad, REG_REPORT_RING(channo));
270 residue2 = admac_peek(ad, REG_RESIDUE(channo));
271
272 if (residue2 > residue1) {
273 // engine must have loaded next descriptor between the two residue reads
274 nreports = admac_ring_noccupied_slots(ring1) + 1;
275 } else {
276 // no descriptor load between the two reads, ring2 is safe to use
277 nreports = admac_ring_noccupied_slots(ring2);
278 }
279
280 pos = adtx->reclaimed_pos + adtx->period_len * (nreports + 1) \
281 - residue2;
282
283 return adtx->buf_len - pos % adtx->buf_len;
284 }
285

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