[xlnx:xlnx_rebase_v5.4 19/1698] drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type

kernel test robot lkp at intel.com
Thu Jan 21 16:05:24 EST 2021


Hi Naga,

FYI, the error/warning still remains.

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   6ccc4c949a216b74368d280af00ac0cecf6fea07
commit: 1dea215e98f470c4fabe230cb5dcb648e3301fb9 [19/1698] mtd: rawnand: Add support for ARASAN NAND controller
config: arc-randconfig-r014-20210121 (attached as .config)
compiler: arceb-elf-gcc (GCC) 9.3.0
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
        # https://github.com/Xilinx/linux-xlnx/commit/1dea215e98f470c4fabe230cb5dcb648e3301fb9
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout 1dea215e98f470c4fabe230cb5dcb648e3301fb9
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/swab.h:5,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/arc/include/uapi/asm/byteorder.h:14,
                    from include/asm-generic/bitops/le.h:6,
                    from arch/arc/include/asm/bitops.h:429,
                    from include/linux/bitops.h:26,
                    from include/linux/kernel.h:12,
                    from include/linux/clk.h:13,
                    from drivers/mtd/nand/raw/arasan_nand.c:10:
   drivers/mtd/nand/raw/arasan_nand.c: In function 'anfc_rw_dma_op':
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:117:32: note: in definition of macro '__swab32'
     117 |  (__builtin_constant_p((__u32)(x)) ? \
         |                                ^
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:18:12: note: in definition of macro '___constant_swab32'
      18 |  (((__u32)(x) & (__u32)0x000000ffUL) << 24) |  \
         |            ^
   include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
      33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                                           ^~~~~~~~
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:19:12: note: in definition of macro '___constant_swab32'
      19 |  (((__u32)(x) & (__u32)0x0000ff00UL) <<  8) |  \
         |            ^
   include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
      33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                                           ^~~~~~~~
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:20:12: note: in definition of macro '___constant_swab32'
      20 |  (((__u32)(x) & (__u32)0x00ff0000UL) >>  8) |  \
         |            ^
   include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
      33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                                           ^~~~~~~~
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:21:12: note: in definition of macro '___constant_swab32'
      21 |  (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
         |            ^
   include/uapi/linux/byteorder/big_endian.h:33:43: note: in expansion of macro '__swab32'
      33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                                           ^~~~~~~~
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~
>> drivers/mtd/nand/raw/arasan_nand.c:365:16: warning: right shift count >= width of type [-Wshift-count-overflow]
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |                ^~
   include/uapi/linux/swab.h:119:12: note: in definition of macro '__swab32'
     119 |  __fswab32(x))
         |            ^
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   arch/arc/include/asm/io.h:213:36: note: in expansion of macro 'writel_relaxed'
     213 | #define writel(v,c)  ({ __iowmb(); writel_relaxed(v,c); })
         |                                    ^~~~~~~~~~~~~~
   drivers/mtd/nand/raw/arasan_nand.c:365:2: note: in expansion of macro 'writel'
     365 |  writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
         |  ^~~~~~


vim +365 drivers/mtd/nand/raw/arasan_nand.c

   337	
   338	static void anfc_rw_dma_op(struct mtd_info *mtd, u8 *buf, int len,
   339				   bool do_read, u32 prog, int pktcount, int pktsize)
   340	{
   341		dma_addr_t paddr;
   342		struct nand_chip *chip = mtd_to_nand(mtd);
   343		struct anfc_nand_controller *nfc = to_anfc(chip->controller);
   344		struct anfc_nand_chip *achip = to_anfc_nand(chip);
   345		u32 eccintr = 0, dir;
   346	
   347		if (pktsize == 0)
   348			pktsize = len;
   349	
   350		anfc_setpktszcnt(nfc, pktsize, pktcount);
   351	
   352		if (!achip->strength)
   353			eccintr = MBIT_ERROR;
   354	
   355		if (do_read)
   356			dir = DMA_FROM_DEVICE;
   357		else
   358			dir = DMA_TO_DEVICE;
   359		paddr = dma_map_single(nfc->dev, buf, len, dir);
   360		if (dma_mapping_error(nfc->dev, paddr)) {
   361			dev_err(nfc->dev, "Read buffer mapping error");
   362			return;
   363		}
   364		writel(paddr, nfc->base + DMA_ADDR0_OFST);
 > 365		writel((paddr >> 32), nfc->base + DMA_ADDR1_OFST);
   366		anfc_enable_intrs(nfc, (XFER_COMPLETE | eccintr));
   367		writel(prog, nfc->base + PROG_OFST);
   368		anfc_wait_for_event(nfc);
   369		dma_unmap_single(nfc->dev, paddr, len, dir);
   370	}
   371	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 22214 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210122/d962247f/attachment-0001.gz>


More information about the linux-arm-kernel mailing list