linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bo Jiao <Bo.Jiao@mediatek.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Felix Fietkau <nbd@nbd.name>,
	Sujuan Chen <sujuan.chen@mediatek.com>,
	Ryder Lee <ryder.lee@mediatek.com>
Subject: drivers/net/wireless/mediatek/mt76/mt7915/mmio.c:341 __mt7915_reg_addr() warn: always true condition '(addr <= 4294967295) => (0-u32max <= u32max)'
Date: Tue, 16 Aug 2022 11:49:07 +0800	[thread overview]
Message-ID: <202208161128.vhPmbgKV-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   568035b01cfb107af8d2e4bd2fb9aea22cf5b868
commit: cd4c314a65d3cce6486f8303e42aca04fd9f9011 mt76: mt7915: refine register definition
date:   6 months ago
config: ia64-randconfig-m031-20220814 (https://download.01.org/0day-ci/archive/20220816/202208161128.vhPmbgKV-lkp@intel.com/config)
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@intel.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

             reply	other threads:[~2022-08-16  7:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  3:49 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-07 23:36 drivers/net/wireless/mediatek/mt76/mt7915/mmio.c:341 __mt7915_reg_addr() warn: always true condition '(addr <= 4294967295) => (0-u32max <= u32max)' kernel test robot
2022-12-04  2:56 kernel test robot
2022-08-19 15:22 kernel test robot
2022-08-18  2:20 kernel test robot
2022-08-15  5:10 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202208161128.vhPmbgKV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Bo.Jiao@mediatek.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=ryder.lee@mediatek.com \
    --cc=sujuan.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).