drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:107:23: sparse: sparse: restricted __le32 degrades to integer
From: kernel test robot
Date: Fri Nov 10 2023 - 22:55:12 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3ca112b71f35dd5d99fc4571a56b5fc6f0c15814
commit: 25e80cd05ff81e51750106f1ae12364449ec38e7 net: stmmac: Get correct timestamp values from XGMAC
date: 4 years, 3 months ago
config: i386-randconfig-062-20230914 (https://download.01.org/0day-ci/archive/20231111/202311111127.0cYR4j6Z-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/20231111/202311111127.0cYR4j6Z-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/202311111127.0cYR4j6Z-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:107:23: sparse: sparse: restricted __le32 degrades to integer
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c:107:50: sparse: sparse: restricted __le32 degrades to integer
vim +107 drivers/net/ethernet/stmicro/stmmac/dwxgmac2_descs.c
94
95 static int dwxgmac2_rx_check_timestamp(void *desc)
96 {
97 struct dma_desc *p = (struct dma_desc *)desc;
98 unsigned int rdes3 = le32_to_cpu(p->des3);
99 bool desc_valid, ts_valid;
100
101 dma_rmb();
102
103 desc_valid = !(rdes3 & XGMAC_RDES3_OWN) && (rdes3 & XGMAC_RDES3_CTXT);
104 ts_valid = !(rdes3 & XGMAC_RDES3_TSD) && (rdes3 & XGMAC_RDES3_TSA);
105
106 if (likely(desc_valid && ts_valid)) {
> 107 if ((p->des0 == 0xffffffff) && (p->des1 == 0xffffffff))
108 return -EINVAL;
109 return 0;
110 }
111
112 return -EINVAL;
113 }
114
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki