[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202212041014.TjbGvyOt-lkp@intel.com>
Date: Sun, 4 Dec 2022 10:56:57 +0800
From: kernel test robot <lkp@...el.com>
To: Bo Jiao <Bo.Jiao@...iatek.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Felix Fietkau <nbd@....name>,
Sujuan Chen <sujuan.chen@...iatek.com>,
Ryder Lee <ryder.lee@...iatek.com>
Subject: drivers/net/wireless/mediatek/mt76/mt7915/mmio.c:341
__mt7915_reg_addr() warn: always true condition '(addr <= 4294967295) =>
(0-u32max <= u32max)'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: c2bf05db6c78f53ca5cd4b48f3b9b71f78d215f1
commit: cd4c314a65d3cce6486f8303e42aca04fd9f9011 mt76: mt7915: refine register definition
date: 10 months ago
config: ia64-randconfig-m031-20221204
compiler: ia64-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
smatch warnings:
drivers/net/wireless/mediatek/mt76/mt7915/mmio.c:341 __mt7915_reg_addr() warn: always true condition '(addr <= 4294967295) => (0-u32max <= u32max)'
vim +341 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c
311
312 static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)
313 {
314 int i;
315
316 if (addr < 0x100000)
317 return addr;
318
319 if (!dev->reg.map) {
320 dev_err(dev->mt76.dev, "err: reg_map is null\n");
321 return addr;
322 }
323
324 for (i = 0; i < dev->reg.map_size; i++) {
325 u32 ofs;
326
327 if (addr < dev->reg.map[i].phys)
328 continue;
329
330 ofs = addr - dev->reg.map[i].phys;
331 if (ofs > dev->reg.map[i].size)
332 continue;
333
334 return dev->reg.map[i].maps + ofs;
335 }
336
337 if ((addr >= MT_INFRA_BASE && addr < MT_WFSYS0_PHY_START) ||
338 (addr >= MT_WFSYS0_PHY_START && addr < MT_WFSYS1_PHY_START) ||
339 (addr >= MT_WFSYS1_PHY_START && addr <= MT_WFSYS1_PHY_END) ||
340 (addr >= MT_CBTOP1_PHY_START && addr <= MT_CBTOP1_PHY_END) ||
> 341 (addr >= MT_CBTOP2_PHY_START && addr <= MT_CBTOP2_PHY_END))
342 return mt7915_reg_map_l1(dev, addr);
343
344 return mt7915_reg_map_l2(dev, addr);
345 }
346
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (171109 bytes)
Powered by blists - more mailing lists