[l1k:bcm2835_spi_clkcache 1/1] drivers/spi/spi-bcm2835.c:1048:6: error: no previous prototype for 'bcm2835_spi_set_clk'

From: kernel test robot
Date: Thu Sep 30 2021 - 10:05:15 EST


tree: https://github.com/l1k/linux bcm2835_spi_clkcache
head: e46f7c6c25bbb03644fd48964df89fa755e0778b
commit: e46f7c6c25bbb03644fd48964df89fa755e0778b [1/1] spi: bcm2835: Avoid unnecessary recalculation of CLK register
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 11.2.0
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/l1k/linux/commit/e46f7c6c25bbb03644fd48964df89fa755e0778b
git remote add l1k https://github.com/l1k/linux
git fetch --no-tags l1k bcm2835_spi_clkcache
git checkout e46f7c6c25bbb03644fd48964df89fa755e0778b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nios2

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

All errors (new ones prefixed by >>):

>> drivers/spi/spi-bcm2835.c:1048:6: error: no previous prototype for 'bcm2835_spi_set_clk' [-Werror=missing-prototypes]
1048 | void bcm2835_spi_set_clk(struct bcm2835_spi *bs, struct spi_transfer *tfr)
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors


vim +/bcm2835_spi_set_clk +1048 drivers/spi/spi-bcm2835.c

1047
> 1048 void bcm2835_spi_set_clk(struct bcm2835_spi *bs, struct spi_transfer *tfr)
1049 {
1050 unsigned long spi_hz = bs->speed_hz = tfr->speed_hz;
1051 unsigned long cdiv;
1052
1053 if (spi_hz >= bs->clk_hz / 2) {
1054 cdiv = 2; /* clk_hz/2 is the fastest we can go */
1055 } else if (spi_hz) {
1056 /* CDIV must be a multiple of two */
1057 cdiv = DIV_ROUND_UP(bs->clk_hz, spi_hz);
1058 cdiv += (cdiv % 2);
1059
1060 if (cdiv >= 65536)
1061 cdiv = 0; /* 0 is the slowest we can go */
1062 } else {
1063 cdiv = 0; /* 0 is the slowest we can go */
1064 }
1065
1066 tfr->effective_speed_hz = bs->effective_speed_hz =
1067 cdiv ? (bs->clk_hz / cdiv) : (bs->clk_hz / 65536);
1068
1069 bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv);
1070 }
1071

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip