[xlnx:xlnx_rebase_v5.4 1102/1697] arch/xtensa/include/uapi/asm/swab.h:24:5: warning: 'pmap' may be used uninitialized in this function

kernel test robot lkp at intel.com
Tue Jan 12 13:11:55 EST 2021


tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   629150468791671b5fde21363e643e87c5815b17
commit: bbcf6f9bb1bc206330ca4d423e5a3966d8d82110 [1102/1697] net: xilinx: Add support for PL TSN IP features
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-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/bbcf6f9bb1bc206330ca4d423e5a3966d8d82110
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx xlnx_rebase_v5.4
        git checkout bbcf6f9bb1bc206330ca4d423e5a3966d8d82110
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa 

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

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/netdevice.h:24,
                    from drivers/net/ethernet/xilinx/xilinx_axienet.h:12,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.h:21,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.c:18:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   arch/xtensa/include/asm/page.h:190:32: note: in expansion of macro 'pfn_valid'
     190 | #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
         |                                ^~~~~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from ./arch/xtensa/include/generated/asm/bug.h:1,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/xtensa/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/timer.h:6,
                    from include/linux/netdevice.h:24,
                    from drivers/net/ethernet/xilinx/xilinx_axienet.h:12,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.h:21,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.c:18:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/xtensa/include/asm/page.h:182:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     182 |  ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
         |         ^~
   include/asm-generic/bug.h:139:27: note: in definition of macro 'WARN_ON_ONCE'
     139 |  int __ret_warn_once = !!(condition);   \
         |                           ^~~~~~~~~
   include/linux/dma-mapping.h:355:19: note: in expansion of macro 'pfn_valid'
     355 |  if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
         |                   ^~~~~~~~~
   In file included from include/uapi/linux/swab.h:7,
                    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/xtensa/include/uapi/asm/byteorder.h:8,
                    from arch/xtensa/include/asm/bitops.h:21,
                    from include/linux/bitops.h:26,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/netdevice.h:24,
                    from drivers/net/ethernet/xilinx/xilinx_axienet.h:12,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.h:21,
                    from drivers/net/ethernet/xilinx/xilinx_tsn_switch.c:18:
   drivers/net/ethernet/xilinx/xilinx_tsn_switch.c: In function 'tsnswitch_probe':
>> arch/xtensa/include/uapi/asm/swab.h:24:5: warning: 'pmap' may be used uninitialized in this function [-Wmaybe-uninitialized]
      24 |     __asm__("ssai     8           \n\t"
         |     ^~~~~~~
   drivers/net/ethernet/xilinx/xilinx_tsn_switch.c:580:6: note: 'pmap' was declared here
     580 |  u32 pmap;
         |      ^~~~


vim +/pmap +24 arch/xtensa/include/uapi/asm/swab.h

8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  19  
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  20  static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  21  {
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  22      __u32 res;
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  23      /* instruction sequence from Xtensa ISA release 2/2000 */
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07 @24      __asm__("ssai     8           \n\t"
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  25  	    "srli     %0, %1, 16  \n\t"
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  26  	    "src      %0, %0, %1  \n\t"
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  27  	    "src      %0, %0, %0  \n\t"
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  28  	    "src      %0, %1, %0  \n"
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  29  	    : "=&a" (res)
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  30  	    : "a" (x)
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  31  	    );
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  32      return res;
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  33  }
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  34  #define __arch_swab32 __arch_swab32
8903709b054a8d arch/xtensa/include/asm/swab.h Harvey Harrison 2009-01-07  35  

:::::: The code at line 24 was first introduced by commit
:::::: 8903709b054a8dafe4e8c6d9a6444034d7aba36f xtensa: introduce swab.h

:::::: TO: Harvey Harrison <harvey.harrison at gmail.com>
:::::: CC: Linus Torvalds <torvalds at linux-foundation.org>

---
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: 61029 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210113/17054103/attachment-0001.gz>


More information about the linux-arm-kernel mailing list