Skip to contentSkip to conversation

drivers/dma/ste_dma40.c:1444:25: sparse: sparse: incorrect type in assignment (different address spaces)

PATCH kernel test robot 1 participant 1 message Oct 9

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next
head:   1d8ae2003de08f61095e4e928b1b8cce6c23cabd
commit: c80edceff29ee212987c2d2c851b2cb2eb4b477a [109/138] dmaengine: ste_dma40: Fix cyclic transfer residue
config: arm-randconfig-r2301-20261008 (https://download.01.org/0day-ci/archive/20261009/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.3.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261009/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
drivers/dma/ste_dma40.c:1416:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int * @@
drivers/dma/ste_dma40.c:1416:28: sparse: expected void const volatile [noderef] __iomem *addr
drivers/dma/ste_dma40.c:1416:28: sparse: got unsigned int *

>> drivers/dma/ste_dma40.c:1444:25: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *low_reg @@     got unsigned int * @@
   drivers/dma/ste_dma40.c:1444:25: sparse:     expected void [noderef] __iomem *low_reg
   drivers/dma/ste_dma40.c:1444:25: sparse:     got unsigned int *
>> drivers/dma/ste_dma40.c:1445:26: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __iomem *high_reg @@     got unsigned int * @@

drivers/dma/ste_dma40.c:1445:26: sparse: expected void [noderef] __iomem *high_reg
drivers/dma/ste_dma40.c:1445:26: sparse: got unsigned int *
drivers/dma/ste_dma40.c:1447:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __iomem *low_reg @@ got unsigned int * @@
drivers/dma/ste_dma40.c:1447:25: sparse: expected void [noderef] __iomem *low_reg
drivers/dma/ste_dma40.c:1447:25: sparse: got unsigned int *
drivers/dma/ste_dma40.c:1448:26: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __iomem *high_reg @@ got unsigned int * @@
drivers/dma/ste_dma40.c:1448:26: sparse: expected void [noderef] __iomem *high_reg
drivers/dma/ste_dma40.c:1448:26: sparse: got unsigned int *
drivers/dma/ste_dma40.c:1490:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got unsigned int * @@
drivers/dma/ste_dma40.c:1490:27: sparse: expected void const volatile [noderef] __iomem *addr
drivers/dma/ste_dma40.c:1490:27: sparse: got unsigned int *
drivers/dma/ste_dma40.c:3638:25: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *lcpa_base @@ got void [noderef] __iomem * @@
drivers/dma/ste_dma40.c:3638:25: sparse: expected void *lcpa_base
drivers/dma/ste_dma40.c:3638:25: sparse: got void [noderef] __iomem *
drivers/dma/ste_dma40.c:3654:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *base @@ got void [noderef] __iomem * @@
drivers/dma/ste_dma40.c:3654:38: sparse: expected void *base
drivers/dma/ste_dma40.c:3654:38: sparse: got void [noderef] __iomem *

vim +1444 drivers/dma/ste_dma40.c

1410
1411 static u32 d40_residue(struct d40_chan *d40c)
1412 {
1413 u32 num_elt;
1414
1415 if (chan_is_logical(d40c))

> 1416			num_elt = (readl(&d40c->lcpa->lcsp2) & D40_MEM_LCSP2_ECNT_MASK)
  1417				>> D40_MEM_LCSP2_ECNT_POS;
  1418		else {
  1419			u32 val = readl(chan_base(d40c) + D40_CHAN_REG_SDELT);
  1420			num_elt = (val & D40_SREG_ELEM_PHY_ECNT_MASK)
  1421				  >> D40_SREG_ELEM_PHY_ECNT_POS;
  1422		}
  1423	
  1424		return num_elt * d40c->dma_cfg.dst_info.data_width;
  1425	}
  1426	
  1427	static bool d40_current_addr(struct d40_chan *d40c, dma_addr_t *addr)
  1428	{
  1429		bool dst = d40c->dma_cfg.dir == DMA_DEV_TO_MEM;
  1430		void __iomem *high_reg;
  1431		void __iomem *low_reg;
  1432		u32 low;
  1433		u32 high;
  1434		u32 check;
  1435		int i;
  1436	
  1437		if (chan_is_physical(d40c)) {
  1438			*addr = readl(chan_base(d40c) +
  1439				      (dst ? D40_CHAN_REG_SDPTR : D40_CHAN_REG_SSPTR));
  1440			return true;
  1441		}
  1442	
  1443		if (dst) {
> 1444			low_reg = &d40c->lcpa->lcsp2;
> 1445			high_reg = &d40c->lcpa->lcsp3;

1446 } else {
1447 low_reg = &d40c->lcpa->lcsp0;
1448 high_reg = &d40c->lcpa->lcsp1;
1449 }
1450
1451 for (i = 0; i < D40_RESIDUE_MAX_ATTEMPTS; i++) {
1452 high = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
1453 low = readl(low_reg) & D40_MEM_LCSP0_SPTR_MASK;
1454 check = readl(high_reg) & D40_MEM_LCSP1_SPTR_MASK;
1455 if (high == check) {
1456 *addr = low | high;
1457 return true;
1458 }
1459 }
1460
1461 return false;
1462 }
1463

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki