drivers/usb/cdns3/cdnsp-gadget.c:159:9: sparse: sparse: cast from restricted __le32

From: kernel test robot

Date: Fri Feb 13 2026 - 22:32:15 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f50822fd8675c68d294e89bd102f7b487ca3acd3
commit: 241e2ce88e5a494be7a5d44c0697592f1632fbee usb: cdnsp: Fix issue with resuming from L1
date: 10 months ago
config: riscv-randconfig-r131-20260214 (https://download.01.org/0day-ci/archive/20260214/202602141123.IHT5qoHR-lkp@xxxxxxxxx/config)
compiler: riscv64-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260214/202602141123.IHT5qoHR-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/202602141123.IHT5qoHR-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
drivers/usb/cdns3/cdnsp-gadget.c:157:16: sparse: sparse: cast to restricted __le32
>> drivers/usb/cdns3/cdnsp-gadget.c:159:9: sparse: sparse: cast from restricted __le32

vim +159 drivers/usb/cdns3/cdnsp-gadget.c

141
142 static void cdnsp_set_apb_timeout_value(struct cdnsp_device *pdev)
143 {
144 struct cdns *cdns = dev_get_drvdata(pdev->dev);
145 __le32 __iomem *reg;
146 void __iomem *base;
147 u32 offset = 0;
148 u32 val;
149
150 if (!cdns->override_apb_timeout)
151 return;
152
153 base = &pdev->cap_regs->hc_capbase;
154 offset = cdnsp_find_next_ext_cap(base, offset, D_XEC_PRE_REGS_CAP);
155 reg = base + offset + REG_CHICKEN_BITS_3_OFFSET;
156
157 val = le32_to_cpu(readl(reg));
158 val = CHICKEN_APB_TIMEOUT_SET(val, cdns->override_apb_timeout);
> 159 writel(cpu_to_le32(val), reg);
160 }
161

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki