[linux-next:master 12878/13550] drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8702f95941c215501826ea8743a8b64b83479209
commit: eb967e310b107daa81203c41cacaffe192415b54 [12878/13550] Merge remote-tracking branch 'nand/nand/next'
config: riscv-randconfig-r033-20210626 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 557b101ce714e39438ba1d39c4c50b03e12fcb96)
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
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=eb967e310b107daa81203c41cacaffe192415b54
        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 eb967e310b107daa81203c41cacaffe192415b54
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

   In file included from drivers/mtd/nand/raw/arasan-nand-controller.c:17:
   In file included from include/linux/dma-mapping.h:10:
   In file included from include/linux/scatterlist.h:8:
   In file included from include/linux/mm.h:33:
   In file included from include/linux/pgtable.h:6:
   arch/riscv/include/asm/pgtable.h:520:9: error: implicit declaration of function 'pfn_pmd' [-Werror,-Wimplicit-function-declaration]
           return pfn_pmd(page_to_pfn(page), prot);
                  ^
   arch/riscv/include/asm/pgtable.h:520:9: note: did you mean 'pfn_pgd'?
   arch/riscv/include/asm/pgtable.h:221:21: note: 'pfn_pgd' declared here
   static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
                       ^
   arch/riscv/include/asm/pgtable.h:520:9: error: returning 'int' from a function with incompatible result type 'pmd_t'
           return pfn_pmd(page_to_pfn(page), prot);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mtd/nand/raw/arasan-nand-controller.c:1453:33: warning: shift count >= width of type [-Wshift-count-overflow]
           ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
                                          ^~~~~~~~~~~~~~~~
   include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
                                                        ^ ~~~
   1 warning and 2 errors generated.


vim +1453 drivers/mtd/nand/raw/arasan-nand-controller.c

197b88fecc50ee Miquel Raynal 2020-05-19  1416  
197b88fecc50ee Miquel Raynal 2020-05-19  1417  static int anfc_probe(struct platform_device *pdev)
197b88fecc50ee Miquel Raynal 2020-05-19  1418  {
197b88fecc50ee Miquel Raynal 2020-05-19  1419  	struct arasan_nfc *nfc;
197b88fecc50ee Miquel Raynal 2020-05-19  1420  	int ret;
197b88fecc50ee Miquel Raynal 2020-05-19  1421  
197b88fecc50ee Miquel Raynal 2020-05-19  1422  	nfc = devm_kzalloc(&pdev->dev, sizeof(*nfc), GFP_KERNEL);
197b88fecc50ee Miquel Raynal 2020-05-19  1423  	if (!nfc)
197b88fecc50ee Miquel Raynal 2020-05-19  1424  		return -ENOMEM;
197b88fecc50ee Miquel Raynal 2020-05-19  1425  
197b88fecc50ee Miquel Raynal 2020-05-19  1426  	nfc->dev = &pdev->dev;
197b88fecc50ee Miquel Raynal 2020-05-19  1427  	nand_controller_init(&nfc->controller);
197b88fecc50ee Miquel Raynal 2020-05-19  1428  	nfc->controller.ops = &anfc_ops;
197b88fecc50ee Miquel Raynal 2020-05-19  1429  	INIT_LIST_HEAD(&nfc->chips);
197b88fecc50ee Miquel Raynal 2020-05-19  1430  
197b88fecc50ee Miquel Raynal 2020-05-19  1431  	nfc->base = devm_platform_ioremap_resource(pdev, 0);
197b88fecc50ee Miquel Raynal 2020-05-19  1432  	if (IS_ERR(nfc->base))
197b88fecc50ee Miquel Raynal 2020-05-19  1433  		return PTR_ERR(nfc->base);
197b88fecc50ee Miquel Raynal 2020-05-19  1434  
197b88fecc50ee Miquel Raynal 2020-05-19  1435  	anfc_reset(nfc);
197b88fecc50ee Miquel Raynal 2020-05-19  1436  
197b88fecc50ee Miquel Raynal 2020-05-19  1437  	nfc->controller_clk = devm_clk_get(&pdev->dev, "controller");
197b88fecc50ee Miquel Raynal 2020-05-19  1438  	if (IS_ERR(nfc->controller_clk))
197b88fecc50ee Miquel Raynal 2020-05-19  1439  		return PTR_ERR(nfc->controller_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1440  
197b88fecc50ee Miquel Raynal 2020-05-19  1441  	nfc->bus_clk = devm_clk_get(&pdev->dev, "bus");
197b88fecc50ee Miquel Raynal 2020-05-19  1442  	if (IS_ERR(nfc->bus_clk))
197b88fecc50ee Miquel Raynal 2020-05-19  1443  		return PTR_ERR(nfc->bus_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1444  
197b88fecc50ee Miquel Raynal 2020-05-19  1445  	ret = clk_prepare_enable(nfc->controller_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1446  	if (ret)
197b88fecc50ee Miquel Raynal 2020-05-19  1447  		return ret;
197b88fecc50ee Miquel Raynal 2020-05-19  1448  
197b88fecc50ee Miquel Raynal 2020-05-19  1449  	ret = clk_prepare_enable(nfc->bus_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1450  	if (ret)
197b88fecc50ee Miquel Raynal 2020-05-19  1451  		goto disable_controller_clk;
197b88fecc50ee Miquel Raynal 2020-05-19  1452  
cf67edce22c5d7 Miquel Raynal 2021-05-27 @1453  	ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
cf67edce22c5d7 Miquel Raynal 2021-05-27  1454  	if (ret)
cf67edce22c5d7 Miquel Raynal 2021-05-27  1455  		goto disable_bus_clk;
cf67edce22c5d7 Miquel Raynal 2021-05-27  1456  
acbd3d0945f9cc Miquel Raynal 2021-05-26  1457  	ret = anfc_parse_cs(nfc);
acbd3d0945f9cc Miquel Raynal 2021-05-26  1458  	if (ret)
acbd3d0945f9cc Miquel Raynal 2021-05-26  1459  		goto disable_bus_clk;
acbd3d0945f9cc Miquel Raynal 2021-05-26  1460  
197b88fecc50ee Miquel Raynal 2020-05-19  1461  	ret = anfc_chips_init(nfc);
197b88fecc50ee Miquel Raynal 2020-05-19  1462  	if (ret)
197b88fecc50ee Miquel Raynal 2020-05-19  1463  		goto disable_bus_clk;
197b88fecc50ee Miquel Raynal 2020-05-19  1464  
197b88fecc50ee Miquel Raynal 2020-05-19  1465  	platform_set_drvdata(pdev, nfc);
197b88fecc50ee Miquel Raynal 2020-05-19  1466  
197b88fecc50ee Miquel Raynal 2020-05-19  1467  	return 0;
197b88fecc50ee Miquel Raynal 2020-05-19  1468  
197b88fecc50ee Miquel Raynal 2020-05-19  1469  disable_bus_clk:
197b88fecc50ee Miquel Raynal 2020-05-19  1470  	clk_disable_unprepare(nfc->bus_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1471  
197b88fecc50ee Miquel Raynal 2020-05-19  1472  disable_controller_clk:
197b88fecc50ee Miquel Raynal 2020-05-19  1473  	clk_disable_unprepare(nfc->controller_clk);
197b88fecc50ee Miquel Raynal 2020-05-19  1474  
197b88fecc50ee Miquel Raynal 2020-05-19  1475  	return ret;
197b88fecc50ee Miquel Raynal 2020-05-19  1476  }
197b88fecc50ee Miquel Raynal 2020-05-19  1477  

:::::: The code at line 1453 was first introduced by commit
:::::: cf67edce22c5d7edc6cad64dbeb1d5d7d0099837 mtd: rawnand: arasan: Use the right DMA mask

:::::: TO: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
:::::: CC: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux