From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: drivers/spi/spi-loongson-core.c:46:15: sparse: sparse: too long token expansion
Date: Wed, 8 Nov 2023 06:44:55 +0800 [thread overview]
Message-ID: <202311080515.AMpF3Xli-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence static check first_new_problem: drivers/spi/spi-loongson-core.c:46:15: sparse: sparse: too long token expansion"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: David Laight <David.Laight@ACULAB.COM>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 13d88ac54ddd1011b6e94443958e798aa06eb835
commit: d03eba99f5bf7cbc6e2fdde3b6fa36954ad58e09 minmax: allow min()/max()/clamp() if the arguments have the same signedness.
date: 3 weeks ago
:::::: branch date: 66 minutes ago
:::::: commit date: 3 weeks ago
config: mips-randconfig-r131-20231107 (https://download.01.org/0day-ci/archive/20231108/202311080515.AMpF3Xli-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231108/202311080515.AMpF3Xli-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202311080515.AMpF3Xli-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-loongson-core.c:46:15: sparse: sparse: too long token expansion
>> drivers/spi/spi-loongson-core.c:46:15: sparse: sparse: too long token expansion
>> drivers/spi/spi-loongson-core.c:46:15: sparse: sparse: too long token expansion
vim +46 drivers/spi/spi-loongson-core.c
6c7a864007b66e Yinbo Zhu 2023-06-13 39
6c7a864007b66e Yinbo Zhu 2023-06-13 40 static void loongson_spi_set_clk(struct loongson_spi *loongson_spi, unsigned int hz)
6c7a864007b66e Yinbo Zhu 2023-06-13 41 {
6c7a864007b66e Yinbo Zhu 2023-06-13 42 unsigned char val;
6c7a864007b66e Yinbo Zhu 2023-06-13 43 unsigned int div, div_tmp;
6c7a864007b66e Yinbo Zhu 2023-06-13 44 static const char rdiv[12] = {0, 1, 4, 2, 3, 5, 6, 7, 8, 9, 10, 11};
6c7a864007b66e Yinbo Zhu 2023-06-13 45
6c7a864007b66e Yinbo Zhu 2023-06-13 @46 div = clamp_val(DIV_ROUND_UP_ULL(loongson_spi->clk_rate, hz), 2, 4096);
6c7a864007b66e Yinbo Zhu 2023-06-13 47 div_tmp = rdiv[fls(div - 1)];
6c7a864007b66e Yinbo Zhu 2023-06-13 48 loongson_spi->spcr = (div_tmp & GENMASK(1, 0)) >> 0;
6c7a864007b66e Yinbo Zhu 2023-06-13 49 loongson_spi->sper = (div_tmp & GENMASK(3, 2)) >> 2;
6c7a864007b66e Yinbo Zhu 2023-06-13 50 val = loongson_spi_read_reg(loongson_spi, LOONGSON_SPI_SPCR_REG);
6c7a864007b66e Yinbo Zhu 2023-06-13 51 val &= ~GENMASK(1, 0);
6c7a864007b66e Yinbo Zhu 2023-06-13 52 loongson_spi_write_reg(loongson_spi, LOONGSON_SPI_SPCR_REG, val |
6c7a864007b66e Yinbo Zhu 2023-06-13 53 loongson_spi->spcr);
6c7a864007b66e Yinbo Zhu 2023-06-13 54 val = loongson_spi_read_reg(loongson_spi, LOONGSON_SPI_SPER_REG);
6c7a864007b66e Yinbo Zhu 2023-06-13 55 val &= ~GENMASK(1, 0);
6c7a864007b66e Yinbo Zhu 2023-06-13 56 loongson_spi_write_reg(loongson_spi, LOONGSON_SPI_SPER_REG, val |
6c7a864007b66e Yinbo Zhu 2023-06-13 57 loongson_spi->sper);
6c7a864007b66e Yinbo Zhu 2023-06-13 58 loongson_spi->hz = hz;
6c7a864007b66e Yinbo Zhu 2023-06-13 59 }
6c7a864007b66e Yinbo Zhu 2023-06-13 60
:::::: The code at line 46 was first introduced by commit
:::::: 6c7a864007b66e60a3f64858a9555efed408b048 spi: loongson: add bus driver for the loongson spi controller
:::::: TO: Yinbo Zhu <zhuyinbo@loongson.cn>
:::::: CC: Mark Brown <broonie@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-11-07 22:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202311080515.AMpF3Xli-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.