* [linux-next:master 5399/6030] drivers/spi/spi-mt65xx.c:242:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
@ 2021-08-07 5:07 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-08-07 5:07 UTC (permalink / raw)
To: Mason Zhang; +Cc: kbuild-all, Linux Memory Management List, Mark Brown
[-- Attachment #1: Type: text/plain, Size: 4908 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7999516e20bd9bb5d1f7351cbd05ca529a3a8d60
commit: 04e6bb0d6bb127bac929fb35edd2dd01613c9520 [5399/6030] spi: modify set_cs_timing parameter
config: arm64-randconfig-s032-20210806 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=04e6bb0d6bb127bac929fb35edd2dd01613c9520
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 04e6bb0d6bb127bac929fb35edd2dd01613c9520
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/spi/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-mt65xx.c:242:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> drivers/spi/spi-mt65xx.c:242:24: sparse: unsigned short *
>> drivers/spi/spi-mt65xx.c:242:24: sparse: int *
drivers/spi/spi-mt65xx.c:243:25: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:243:25: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:243:25: sparse: int *
drivers/spi/spi-mt65xx.c:251:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:251:24: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:251:24: sparse: int *
drivers/spi/spi-mt65xx.c:252:25: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:252:25: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:252:25: sparse: int *
drivers/spi/spi-mt65xx.c:261:20: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:261:20: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:261:20: sparse: int *
vim +242 drivers/spi/spi-mt65xx.c
210
211 static int mtk_spi_set_hw_cs_timing(struct spi_device *spi)
212 {
213 struct mtk_spi *mdata = spi_master_get_devdata(spi->master);
214 struct spi_delay *cs_setup = &spi->cs_setup;
215 struct spi_delay *cs_hold = &spi->cs_hold;
216 struct spi_delay *cs_inactive = &spi->cs_inactive;
217 u16 setup, hold, inactive;
218 u32 reg_val;
219 int delay;
220
221 delay = spi_delay_to_ns(cs_setup, NULL);
222 if (delay < 0)
223 return delay;
224 setup = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
225
226 delay = spi_delay_to_ns(cs_hold, NULL);
227 if (delay < 0)
228 return delay;
229 hold = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
230
231 delay = spi_delay_to_ns(cs_inactive, NULL);
232 if (delay < 0)
233 return delay;
234 inactive = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
235
236 setup = setup ? setup : 1;
237 hold = hold ? hold : 1;
238 inactive = inactive ? inactive : 1;
239
240 reg_val = readl(mdata->base + SPI_CFG0_REG);
241 if (mdata->dev_comp->enhance_timing) {
> 242 hold = min(hold, 0xffff);
243 setup = min(setup, 0xffff);
244 reg_val &= ~(0xffff << SPI_ADJUST_CFG0_CS_HOLD_OFFSET);
245 reg_val |= (((hold - 1) & 0xffff)
246 << SPI_ADJUST_CFG0_CS_HOLD_OFFSET);
247 reg_val &= ~(0xffff << SPI_ADJUST_CFG0_CS_SETUP_OFFSET);
248 reg_val |= (((setup - 1) & 0xffff)
249 << SPI_ADJUST_CFG0_CS_SETUP_OFFSET);
250 } else {
251 hold = min(hold, 0xff);
252 setup = min(setup, 0xff);
253 reg_val &= ~(0xff << SPI_CFG0_CS_HOLD_OFFSET);
254 reg_val |= (((hold - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
255 reg_val &= ~(0xff << SPI_CFG0_CS_SETUP_OFFSET);
256 reg_val |= (((setup - 1) & 0xff)
257 << SPI_CFG0_CS_SETUP_OFFSET);
258 }
259 writel(reg_val, mdata->base + SPI_CFG0_REG);
260
261 inactive = min(inactive, 0xff);
262 reg_val = readl(mdata->base + SPI_CFG1_REG);
263 reg_val &= ~SPI_CFG1_CS_IDLE_MASK;
264 reg_val |= (((inactive - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
265 writel(reg_val, mdata->base + SPI_CFG1_REG);
266
267 return 0;
268 }
269
---
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: 42159 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [linux-next:master 5399/6030] drivers/spi/spi-mt65xx.c:242:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
@ 2021-08-07 5:07 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-08-07 5:07 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 5014 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 7999516e20bd9bb5d1f7351cbd05ca529a3a8d60
commit: 04e6bb0d6bb127bac929fb35edd2dd01613c9520 [5399/6030] spi: modify set_cs_timing parameter
config: arm64-randconfig-s032-20210806 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 10.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=04e6bb0d6bb127bac929fb35edd2dd01613c9520
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 04e6bb0d6bb127bac929fb35edd2dd01613c9520
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/spi/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/spi/spi-mt65xx.c:242:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> drivers/spi/spi-mt65xx.c:242:24: sparse: unsigned short *
>> drivers/spi/spi-mt65xx.c:242:24: sparse: int *
drivers/spi/spi-mt65xx.c:243:25: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:243:25: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:243:25: sparse: int *
drivers/spi/spi-mt65xx.c:251:24: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:251:24: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:251:24: sparse: int *
drivers/spi/spi-mt65xx.c:252:25: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:252:25: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:252:25: sparse: int *
drivers/spi/spi-mt65xx.c:261:20: sparse: sparse: incompatible types in comparison expression (different type sizes):
drivers/spi/spi-mt65xx.c:261:20: sparse: unsigned short *
drivers/spi/spi-mt65xx.c:261:20: sparse: int *
vim +242 drivers/spi/spi-mt65xx.c
210
211 static int mtk_spi_set_hw_cs_timing(struct spi_device *spi)
212 {
213 struct mtk_spi *mdata = spi_master_get_devdata(spi->master);
214 struct spi_delay *cs_setup = &spi->cs_setup;
215 struct spi_delay *cs_hold = &spi->cs_hold;
216 struct spi_delay *cs_inactive = &spi->cs_inactive;
217 u16 setup, hold, inactive;
218 u32 reg_val;
219 int delay;
220
221 delay = spi_delay_to_ns(cs_setup, NULL);
222 if (delay < 0)
223 return delay;
224 setup = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
225
226 delay = spi_delay_to_ns(cs_hold, NULL);
227 if (delay < 0)
228 return delay;
229 hold = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
230
231 delay = spi_delay_to_ns(cs_inactive, NULL);
232 if (delay < 0)
233 return delay;
234 inactive = (delay * DIV_ROUND_UP(mdata->spi_clk_hz, 1000000)) / 1000;
235
236 setup = setup ? setup : 1;
237 hold = hold ? hold : 1;
238 inactive = inactive ? inactive : 1;
239
240 reg_val = readl(mdata->base + SPI_CFG0_REG);
241 if (mdata->dev_comp->enhance_timing) {
> 242 hold = min(hold, 0xffff);
243 setup = min(setup, 0xffff);
244 reg_val &= ~(0xffff << SPI_ADJUST_CFG0_CS_HOLD_OFFSET);
245 reg_val |= (((hold - 1) & 0xffff)
246 << SPI_ADJUST_CFG0_CS_HOLD_OFFSET);
247 reg_val &= ~(0xffff << SPI_ADJUST_CFG0_CS_SETUP_OFFSET);
248 reg_val |= (((setup - 1) & 0xffff)
249 << SPI_ADJUST_CFG0_CS_SETUP_OFFSET);
250 } else {
251 hold = min(hold, 0xff);
252 setup = min(setup, 0xff);
253 reg_val &= ~(0xff << SPI_CFG0_CS_HOLD_OFFSET);
254 reg_val |= (((hold - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
255 reg_val &= ~(0xff << SPI_CFG0_CS_SETUP_OFFSET);
256 reg_val |= (((setup - 1) & 0xff)
257 << SPI_CFG0_CS_SETUP_OFFSET);
258 }
259 writel(reg_val, mdata->base + SPI_CFG0_REG);
260
261 inactive = min(inactive, 0xff);
262 reg_val = readl(mdata->base + SPI_CFG1_REG);
263 reg_val &= ~SPI_CFG1_CS_IDLE_MASK;
264 reg_val |= (((inactive - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
265 writel(reg_val, mdata->base + SPI_CFG1_REG);
266
267 return 0;
268 }
269
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 42159 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-07 5:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-07 5:07 [linux-next:master 5399/6030] drivers/spi/spi-mt65xx.c:242:24: sparse: sparse: incompatible types in comparison expression (different type sizes): kernel test robot
2021-08-07 5:07 ` kernel test robot
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.