From: kernel test robot <lkp@intel.com>
To: Sujuan Chen <sujuan.chen@mediatek.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Felix Fietkau <nbd@nbd.name>, Rex Lu <rex.lu@mediatek.com>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: [nbd168-wireless:mt76 58/62] drivers/net/wireless/mediatek/mt76/mmio.c:146:39: warning: shift count >= width of type
Date: Thu, 7 Dec 2023 10:21:09 +0800 [thread overview]
Message-ID: <202312071044.ks9eUdyG-lkp@intel.com> (raw)
tree: https://github.com/nbd168/wireless mt76
head: 131c05dd91da2a13df20d4e5671e7c90d510bf69
commit: 950aaa76922a903f2431d36e9093327dc0e8ff9c [58/62] wifi: mt76: mt7996: set DMA mask to 36 bits for boards with more than 4GB of RAM
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20231207/202312071044.ks9eUdyG-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231207/202312071044.ks9eUdyG-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312071044.ks9eUdyG-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/net/wireless/mediatek/mt76/mmio.c:6:
In file included from drivers/net/wireless/mediatek/mt76/mt76.h:10:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/net/wireless/mediatek/mt76/mmio.c:6:
In file included from drivers/net/wireless/mediatek/mt76/mt76.h:10:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/net/wireless/mediatek/mt76/mmio.c:6:
In file included from drivers/net/wireless/mediatek/mt76/mt76.h:10:
In file included from include/linux/io.h:13:
In file included from arch/hexagon/include/asm/io.h:337:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> drivers/net/wireless/mediatek/mt76/mmio.c:146:39: warning: shift count >= width of type [-Wshift-count-overflow]
146 | FIELD_PREP(MT_DMA_CTL_SDP0_H, addr >> 32);
| ^ ~~
include/linux/bitfield.h:114:33: note: expanded from macro 'FIELD_PREP'
114 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~
include/linux/bitfield.h:68:41: note: expanded from macro '__BF_FIELD_CHECK'
68 | BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ? \
| ^~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~
include/linux/compiler_types.h:435:22: note: expanded from macro 'compiletime_assert'
435 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:423:23: note: expanded from macro '_compiletime_assert'
423 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:415:9: note: expanded from macro '__compiletime_assert'
415 | if (!(condition)) \
| ^~~~~~~~~
>> drivers/net/wireless/mediatek/mt76/mmio.c:146:39: warning: shift count >= width of type [-Wshift-count-overflow]
146 | FIELD_PREP(MT_DMA_CTL_SDP0_H, addr >> 32);
| ^ ~~
include/linux/bitfield.h:114:33: note: expanded from macro 'FIELD_PREP'
114 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \
| ^~~~
include/linux/bitfield.h:69:39: note: expanded from macro '__BF_FIELD_CHECK'
69 | ~((_mask) >> __bf_shf(_mask)) & (_val) : 0, \
| ^~~~
include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~
include/linux/compiler_types.h:435:22: note: expanded from macro 'compiletime_assert'
435 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~
include/linux/compiler_types.h:423:23: note: expanded from macro '_compiletime_assert'
423 | __compiletime_assert(condition, msg, prefix, suffix)
| ^~~~~~~~~
include/linux/compiler_types.h:415:9: note: expanded from macro '__compiletime_assert'
415 | if (!(condition)) \
| ^~~~~~~~~
>> drivers/net/wireless/mediatek/mt76/mmio.c:146:39: warning: shift count >= width of type [-Wshift-count-overflow]
146 | FIELD_PREP(MT_DMA_CTL_SDP0_H, addr >> 32);
| ^ ~~
include/linux/bitfield.h:115:20: note: expanded from macro 'FIELD_PREP'
115 | ((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask); \
| ^~~~
9 warnings generated.
vim +146 drivers/net/wireless/mediatek/mt76/mmio.c
110
111 u32 mt76_mmio_wed_init_rx_buf(struct mtk_wed_device *wed, int size)
112 {
113 struct mt76_dev *dev = container_of(wed, struct mt76_dev, mmio.wed);
114 struct mtk_wed_bm_desc *desc = wed->rx_buf_ring.desc;
115 struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN];
116 int i, len = SKB_WITH_OVERHEAD(q->buf_size);
117 struct mt76_txwi_cache *t = NULL;
118
119 for (i = 0; i < size; i++) {
120 enum dma_data_direction dir;
121 dma_addr_t addr;
122 u32 offset;
123 int token;
124 void *buf;
125
126 t = mt76_get_rxwi(dev);
127 if (!t)
128 goto unmap;
129
130 buf = mt76_get_page_pool_buf(q, &offset, q->buf_size);
131 if (!buf)
132 goto unmap;
133
134 addr = page_pool_get_dma_addr(virt_to_head_page(buf)) + offset;
135 dir = page_pool_get_dma_dir(q->page_pool);
136 dma_sync_single_for_device(dev->dma_dev, addr, len, dir);
137
138 desc->buf0 = cpu_to_le32(addr);
139 token = mt76_rx_token_consume(dev, buf, t, addr);
140 if (token < 0) {
141 mt76_put_page_pool_buf(buf, false);
142 goto unmap;
143 }
144
145 token = FIELD_PREP(MT_DMA_CTL_TOKEN, token) |
> 146 FIELD_PREP(MT_DMA_CTL_SDP0_H, addr >> 32);
147 desc->token |= cpu_to_le32(token);
148 desc++;
149 }
150
151 return 0;
152
153 unmap:
154 if (t)
155 mt76_put_rxwi(dev, t);
156 mt76_mmio_wed_release_rx_buf(wed);
157
158 return -ENOMEM;
159 }
160 EXPORT_SYMBOL_GPL(mt76_mmio_wed_init_rx_buf);
161
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-12-07 2:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202312071044.ks9eUdyG-lkp@intel.com \
--to=lkp@intel.com \
--cc=llvm@lists.linux.dev \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rex.lu@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