Hi Frank, kernel test robot noticed the following build warnings: [auto build test WARNING on vkoul-dmaengine/next] [also build test WARNING on linus/master v6.7-rc1 next-20231117] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Frank-Li/dmaengine-fsl-edma-involve-help-macro-fsl_edma_set-get-_tcd/20231117-062946 base: https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine.git next patch link: https://lore.kernel.org/r/20231116222743.2984776-2-Frank.Li%40nxp.com patch subject: [PATCH v2 1/5] dmaengine: fsl-edma: involve help macro fsl_edma_set(get)_tcd() config: x86_64-randconfig-r113-20231117 (https://download.01.org/0day-ci/archive/20231118/202311180346.xzja9J4E-lkp@xxxxxxxxx/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311180346.xzja9J4E-lkp@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202311180346.xzja9J4E-lkp@xxxxxxxxx/ sparse warnings: (new ones prefixed by >>) drivers/dma/fsl-edma-common.c:76:15: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:93:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:100:22: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:101:25: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:104:15: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:106:9: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:131:19: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:137:17: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:140:9: sparse: sparse: cast removes address space '__iomem' of expression >> drivers/dma/fsl-edma-common.c:361:26: sparse: sparse: cast to restricted __le16 drivers/dma/fsl-edma-common.c:361:26: sparse: sparse: cast from restricted __le32 >> drivers/dma/fsl-edma-common.c:364:33: sparse: sparse: cast to restricted __le32 drivers/dma/fsl-edma-common.c:364:33: sparse: sparse: cast from restricted __le16 drivers/dma/fsl-edma-common.c:377:26: sparse: sparse: cast to restricted __le16 drivers/dma/fsl-edma-common.c:377:26: sparse: sparse: cast from restricted __le32 drivers/dma/fsl-edma-common.c:381:33: sparse: sparse: cast to restricted __le32 drivers/dma/fsl-edma-common.c:381:33: sparse: sparse: cast from restricted __le16 drivers/dma/fsl-edma-common.c:384:36: sparse: sparse: cast to restricted __le16 drivers/dma/fsl-edma-common.c:384:36: sparse: sparse: cast from restricted __le32 drivers/dma/fsl-edma-common.c:386:36: sparse: sparse: cast to restricted __le16 drivers/dma/fsl-edma-common.c:386:36: sparse: sparse: cast from restricted __le32 drivers/dma/fsl-edma-common.c:457:15: sparse: sparse: cast to restricted __le32 drivers/dma/fsl-edma-common.c:457:15: sparse: sparse: cast from restricted __le16 drivers/dma/fsl-edma-common.c:461:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] csr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:461:17: sparse: expected restricted __le16 [usertype] csr drivers/dma/fsl-edma-common.c:461:17: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:473:17: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:473:17: sparse: sparse: cast removes address space '__iomem' of expression drivers/dma/fsl-edma-common.c:496:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] saddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:496:9: sparse: expected restricted __le32 [usertype] saddr drivers/dma/fsl-edma-common.c:496:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:497:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] daddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:497:9: sparse: expected restricted __le32 [usertype] daddr drivers/dma/fsl-edma-common.c:497:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:499:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] attr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:499:9: sparse: expected restricted __le16 [usertype] attr drivers/dma/fsl-edma-common.c:499:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:501:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] soff @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:501:9: sparse: expected restricted __le16 [usertype] soff drivers/dma/fsl-edma-common.c:501:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:518:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] nbytes @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:518:9: sparse: expected restricted __le32 [usertype] nbytes drivers/dma/fsl-edma-common.c:518:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:519:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] slast @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:519:9: sparse: expected restricted __le32 [usertype] slast drivers/dma/fsl-edma-common.c:519:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:521:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] citer @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:521:9: sparse: expected restricted __le16 [usertype] citer drivers/dma/fsl-edma-common.c:521:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:522:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] doff @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:522:9: sparse: expected restricted __le16 [usertype] doff drivers/dma/fsl-edma-common.c:522:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:524:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] dlast_sga @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:524:9: sparse: expected restricted __le32 [usertype] dlast_sga drivers/dma/fsl-edma-common.c:524:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:526:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] biter @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:526:9: sparse: expected restricted __le16 [usertype] biter drivers/dma/fsl-edma-common.c:526:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:543:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] csr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:543:9: sparse: expected restricted __le16 [usertype] csr drivers/dma/fsl-edma-common.c:543:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:496:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] saddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:496:9: sparse: expected restricted __le32 [usertype] saddr drivers/dma/fsl-edma-common.c:496:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:497:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] daddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:497:9: sparse: expected restricted __le32 [usertype] daddr drivers/dma/fsl-edma-common.c:497:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:499:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] attr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:499:9: sparse: expected restricted __le16 [usertype] attr drivers/dma/fsl-edma-common.c:499:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:501:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] soff @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:501:9: sparse: expected restricted __le16 [usertype] soff drivers/dma/fsl-edma-common.c:501:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:518:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] nbytes @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:518:9: sparse: expected restricted __le32 [usertype] nbytes drivers/dma/fsl-edma-common.c:518:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:519:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] slast @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:519:9: sparse: expected restricted __le32 [usertype] slast drivers/dma/fsl-edma-common.c:519:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:521:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] citer @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:521:9: sparse: expected restricted __le16 [usertype] citer drivers/dma/fsl-edma-common.c:521:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:522:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] doff @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:522:9: sparse: expected restricted __le16 [usertype] doff drivers/dma/fsl-edma-common.c:522:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:524:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] dlast_sga @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:524:9: sparse: expected restricted __le32 [usertype] dlast_sga drivers/dma/fsl-edma-common.c:524:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:526:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] biter @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:526:9: sparse: expected restricted __le16 [usertype] biter drivers/dma/fsl-edma-common.c:526:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:543:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] csr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:543:9: sparse: expected restricted __le16 [usertype] csr drivers/dma/fsl-edma-common.c:543:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:496:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] saddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:496:9: sparse: expected restricted __le32 [usertype] saddr drivers/dma/fsl-edma-common.c:496:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:497:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] daddr @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:497:9: sparse: expected restricted __le32 [usertype] daddr drivers/dma/fsl-edma-common.c:497:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:499:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] attr @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:499:9: sparse: expected restricted __le16 [usertype] attr drivers/dma/fsl-edma-common.c:499:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:501:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le16 [usertype] soff @@ got restricted __le32 [usertype] @@ drivers/dma/fsl-edma-common.c:501:9: sparse: expected restricted __le16 [usertype] soff drivers/dma/fsl-edma-common.c:501:9: sparse: got restricted __le32 [usertype] drivers/dma/fsl-edma-common.c:518:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] nbytes @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:518:9: sparse: expected restricted __le32 [usertype] nbytes drivers/dma/fsl-edma-common.c:518:9: sparse: got restricted __le16 [usertype] drivers/dma/fsl-edma-common.c:519:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] slast @@ got restricted __le16 [usertype] @@ drivers/dma/fsl-edma-common.c:519:9: sparse: expected restricted __le32 [usertype] slast drivers/dma/fsl-edma-common.c:519:9: sparse: got restricted __le16 [usertype] vim +361 drivers/dma/fsl-edma-common.c 348 349 static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, 350 struct virt_dma_desc *vdesc, bool in_progress) 351 { 352 struct fsl_edma_desc *edesc = fsl_chan->edesc; 353 enum dma_transfer_direction dir = edesc->dirn; 354 dma_addr_t cur_addr, dma_addr; 355 size_t len, size; 356 u32 nbytes = 0; 357 int i; 358 359 /* calculate the total size in this desc */ 360 for (len = i = 0; i < fsl_chan->edesc->n_tcds; i++) { > 361 nbytes = fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, nbytes); 362 if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) 363 nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); > 364 len += nbytes * fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, biter); 365 } 366 367 if (!in_progress) 368 return len; 369 370 if (dir == DMA_MEM_TO_DEV) 371 cur_addr = edma_read_tcdreg(fsl_chan, saddr); 372 else 373 cur_addr = edma_read_tcdreg(fsl_chan, daddr); 374 375 /* figure out the finished and calculate the residue */ 376 for (i = 0; i < fsl_chan->edesc->n_tcds; i++) { 377 nbytes = fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, nbytes); 378 if (nbytes & (EDMA_V3_TCD_NBYTES_DMLOE | EDMA_V3_TCD_NBYTES_SMLOE)) 379 nbytes = EDMA_V3_TCD_NBYTES_MLOFF_NBYTES(nbytes); 380 381 size = nbytes * fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, biter); 382 383 if (dir == DMA_MEM_TO_DEV) 384 dma_addr = fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, saddr); 385 else 386 dma_addr = fsl_edma_get_tcd_to_cpu(fsl_chan, edesc->tcd[i].vtcd, daddr); 387 388 len -= size; 389 if (cur_addr >= dma_addr && cur_addr < dma_addr + size) { 390 len += dma_addr + size - cur_addr; 391 break; 392 } 393 } 394 395 return len; 396 } 397 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki