[xlnx:master 128/133] include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast

kernel test robot lkp at intel.com
Tue Oct 6 10:25:51 EDT 2020


tree:   https://github.com/Xilinx/linux-xlnx master
head:   ce42934137e0f2ebb302647095c6939647d3ebaf
commit: e966fbb13383eec0f1d1ab444b248bd0653d2c05 [128/133] net: xilinx: axiethernet: Add check for transmit data FIFO vacancy
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/Xilinx/linux-xlnx/commit/e966fbb13383eec0f1d1ab444b248bd0653d2c05
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx master
        git checkout e966fbb13383eec0f1d1ab444b248bd0653d2c05
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

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/kernel.h:14,
                    from include/linux/clk.h:13,
                    from drivers/net/ethernet/xilinx/xilinx_axienet_main.c:25:
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_create_tsheader':
>> include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast
      12 |  (void)(&__dummy == &__dummy2); \
         |                  ^~
   include/linux/spinlock.h:249:3: note: in expansion of macro 'typecheck'
     249 |   typecheck(unsigned long, flags); \
         |   ^~~~~~~~~
   include/linux/spinlock.h:368:2: note: in expansion of macro 'raw_spin_lock_irqsave'
     368 |  raw_spin_lock_irqsave(spinlock_check(lock), flags); \
         |  ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1058:3: note: in expansion of macro 'spin_lock_irqsave'
    1058 |   spin_lock_irqsave(&lp->ptp_tx_lock, flags);
         |   ^~~~~~~~~~~~~~~~~
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_queue_xmit':
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1253:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    1253 |   const struct ethhdr *eth;
         |   ^~~~~
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c: In function 'axienet_ioctl':
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2172:10: warning: 'regval' may be used uninitialized in this function [-Wmaybe-uninitialized]
    2172 |   regval &= ~XAE_TC_INBAND1588_MASK;
   drivers/net/ethernet/xilinx/xilinx_axienet_main.c:2136:6: note: 'regval' was declared here
    2136 |  u32 regval;
         |      ^~~~~~

vim +12 include/linux/typecheck.h

e0deaff470900a4 Andrew Morton 2008-07-25   4  
e0deaff470900a4 Andrew Morton 2008-07-25   5  /*
e0deaff470900a4 Andrew Morton 2008-07-25   6   * Check at compile time that something is of a particular type.
e0deaff470900a4 Andrew Morton 2008-07-25   7   * Always evaluates to 1 so you may use it easily in comparisons.
e0deaff470900a4 Andrew Morton 2008-07-25   8   */
e0deaff470900a4 Andrew Morton 2008-07-25   9  #define typecheck(type,x) \
e0deaff470900a4 Andrew Morton 2008-07-25  10  ({	type __dummy; \
e0deaff470900a4 Andrew Morton 2008-07-25  11  	typeof(x) __dummy2; \
e0deaff470900a4 Andrew Morton 2008-07-25 @12  	(void)(&__dummy == &__dummy2); \
e0deaff470900a4 Andrew Morton 2008-07-25  13  	1; \
e0deaff470900a4 Andrew Morton 2008-07-25  14  })
e0deaff470900a4 Andrew Morton 2008-07-25  15  

:::::: The code at line 12 was first introduced by commit
:::::: e0deaff470900a4c3222ca7139f6c9639e26a2f5 split the typecheck macros out of include/linux/kernel.h

:::::: TO: Andrew Morton <akpm at linux-foundation.org>
:::::: 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: 71398 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201006/cc9309b4/attachment-0001.gz>


More information about the linux-arm-kernel mailing list