[lpieralisi-pci:pci/mips 2/3] drivers/pci/controller/pci-loongson.c:120:15: warning: no previous prototype for function 'pci_loongson_map_bus'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git pci/mips
head: 783399b028bd386a2969d3d0a292afc48260ab70
commit: b73ad3d4e22e3466ebc8af1f2e04b307b729eb05 [2/3] PCI: Add Loongson PCI Controller support
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout b73ad3d4e22e3466ebc8af1f2e04b307b729eb05
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/pci/controller/pci-loongson.c:49:6: warning: unused variable 'tmp' [-Wunused-variable]
u16 tmp;
^
>> drivers/pci/controller/pci-loongson.c:120:15: warning: no previous prototype for function 'pci_loongson_map_bus' [-Wmissing-prototypes]
void __iomem *pci_loongson_map_bus(struct pci_bus *bus, unsigned int devfn,
^
drivers/pci/controller/pci-loongson.c:120:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __iomem *pci_loongson_map_bus(struct pci_bus *bus, unsigned int devfn,
^
static
2 warnings generated.
vim +/pci_loongson_map_bus +120 drivers/pci/controller/pci-loongson.c
119
> 120 void __iomem *pci_loongson_map_bus(struct pci_bus *bus, unsigned int devfn,
121 int where)
122 {
123 unsigned char busnum = bus->number;
124 struct pci_host_bridge *bridge = pci_find_host_bridge(bus);
125 struct loongson_pci *priv = pci_host_bridge_priv(bridge);
126
127 /*
128 * Do not read more than one device on the bus other than
129 * the host bus. For our hardware the root bus is always bus 0.
130 */
131 if (priv->flags & FLAG_DEV_FIX && busnum != 0 &&
132 PCI_SLOT(devfn) > 0)
133 return NULL;
134
135 /* CFG0 can only access standard space */
136 if (where < PCI_CFG_SPACE_SIZE && priv->cfg0_base)
137 return cfg0_map(priv, busnum, devfn, where);
138
139 /* CFG1 can access extended space */
140 if (where < PCI_CFG_SPACE_EXP_SIZE && priv->cfg1_base)
141 return cfg1_map(priv, busnum, devfn, where);
142
143 return NULL;
144 }
145
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 10235/12102] include/linux/compiler.h:350:38: error: call to '__compiletime_assert_37' declared with attribute error: FIELD_PREP: mask is not constant
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c11d28ab4a691736e30b49813fb801847bd44e83
commit: ac0a95a3ea7811f5cc4489924ddb54f0ea0f3007 [10235/12102] phy: intel: Add driver support for ComboPhy
config: h8300-randconfig-r002-20200524 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ac0a95a3ea7811f5cc4489924ddb54f0ea0f3007
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/build_bug.h:5,
from include/linux/bitfield.h:10,
from drivers/phy/intel/phy-intel-combo.c:8:
drivers/phy/intel/phy-intel-combo.c: In function 'combo_phy_w32_off_mask':
include/linux/bitfield.h:52:28: warning: comparison is always false due to limited range of data type [-Wtype-limits]
52 | BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, | ^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
330 | if (!(condition)) | ^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:52:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
52 | BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull, | ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK'
94 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); | ^~~~~~~~~~~~~~~~
drivers/phy/intel/phy-intel-combo.c:137:13: note: in expansion of macro 'FIELD_PREP'
137 | reg_val |= FIELD_PREP(mask, val);
| ^~~~~~~~~~
>> include/linux/compiler.h:350:38: error: call to '__compiletime_assert_37' declared with attribute error: FIELD_PREP: mask is not constant
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); | ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
46 | BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), | ^~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK'
94 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); | ^~~~~~~~~~~~~~~~
drivers/phy/intel/phy-intel-combo.c:137:13: note: in expansion of macro 'FIELD_PREP'
137 | reg_val |= FIELD_PREP(mask, val);
| ^~~~~~~~~~
>> include/linux/compiler.h:350:38: error: call to '__compiletime_assert_41' declared with attribute error: BUILD_BUG_ON failed: (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) & (((mask) + (1ULL << (__builtin_ffsll(mask) - 1))) - 1)) != 0
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
include/linux/compiler.h:331:4: note: in definition of macro '__compiletime_assert'
331 | prefix ## suffix(); | ^~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
350 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:50:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
| ^~~~~~~~~~~~~~~~
include/linux/build_bug.h:21:2: note: in expansion of macro 'BUILD_BUG_ON'
21 | BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
| ^~~~~~~~~~~~
include/linux/bitfield.h:54:3: note: in expansion of macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
54 | __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/bitfield.h:94:3: note: in expansion of macro '__BF_FIELD_CHECK'
94 | __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); | ^~~~~~~~~~~~~~~~
drivers/phy/intel/phy-intel-combo.c:137:13: note: in expansion of macro 'FIELD_PREP'
137 | reg_val |= FIELD_PREP(mask, val);
| ^~~~~~~~~~
vim +/__compiletime_assert_37 +350 include/linux/compiler.h
9a8ab1c39970a4 Daniel Santos 2013-02-21 336
9a8ab1c39970a4 Daniel Santos 2013-02-21 337 #define _compiletime_assert(condition, msg, prefix, suffix) \
9a8ab1c39970a4 Daniel Santos 2013-02-21 338 __compiletime_assert(condition, msg, prefix, suffix)
9a8ab1c39970a4 Daniel Santos 2013-02-21 339
9a8ab1c39970a4 Daniel Santos 2013-02-21 340 /**
9a8ab1c39970a4 Daniel Santos 2013-02-21 341 * compiletime_assert - break build and emit msg if condition is false
9a8ab1c39970a4 Daniel Santos 2013-02-21 342 * @condition: a compile-time constant condition to check
9a8ab1c39970a4 Daniel Santos 2013-02-21 343 * @msg: a message to emit if condition is false
9a8ab1c39970a4 Daniel Santos 2013-02-21 344 *
9a8ab1c39970a4 Daniel Santos 2013-02-21 345 * In tradition of POSIX assert, this macro will break the build if the
9a8ab1c39970a4 Daniel Santos 2013-02-21 346 * supplied condition is *false*, emitting the supplied error message if the
9a8ab1c39970a4 Daniel Santos 2013-02-21 347 * compiler has support to do so.
9a8ab1c39970a4 Daniel Santos 2013-02-21 348 */
9a8ab1c39970a4 Daniel Santos 2013-02-21 349 #define compiletime_assert(condition, msg) \
af9c5d2e3b3558 Vegard Nossum 2020-04-06 @350 _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
9a8ab1c39970a4 Daniel Santos 2013-02-21 351
:::::: The code at line 350 was first introduced by commit
:::::: af9c5d2e3b355854ff0e4acfbfbfadcd5198a349 compiler.h: fix error in BUILD_BUG_ON() reporting
:::::: TO: Vegard Nossum <vegard.nossum(a)oracle.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[riscv:for-next 8/11] arch/riscv/kernel/kgdb.c:52:5: warning: no previous prototype for 'decode_register_index_short'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head: 44ab661dd29db5956b73ae7553865604f9d725fa
commit: 71e26d08ff3806a4e0198afb3a9858d3bb1b3c9c [8/11] riscv: Add SW single-step support for KDB
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 71e26d08ff3806a4e0198afb3a9858d3bb1b3c9c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
arch/riscv/kernel/kgdb.c:47:5: warning: no previous prototype for 'decode_register_index' [-Wmissing-prototypes]
47 | int decode_register_index(unsigned long opcode, int offset)
| ^~~~~~~~~~~~~~~~~~~~~
<< from arch/riscv/kernel/kgdb.c:9:
>> arch/riscv/kernel/kgdb.c:52:5: warning: no previous prototype for 'decode_register_index_short' [-Wmissing-prototypes]
52 | int decode_register_index_short(unsigned long opcode, int offset)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/kgdb.c:58:5: warning: no previous prototype for 'get_step_address' [-Wmissing-prototypes]
58 | int get_step_address(struct pt_regs *regs, unsigned long *next_addr)
| ^~~~~~~~~~~~~~~~
arch/riscv/kernel/kgdb.c:139:5: warning: no previous prototype for 'do_single_step' [-Wmissing-prototypes]
139 | int do_single_step(struct pt_regs *regs)
| ^~~~~~~~~~~~~~
arch/riscv/kernel/kgdb.c:276:6: warning: no previous prototype for 'kgdb_arch_handle_qxfer_pkt' [-Wmissing-prototypes]
276 | void kgdb_arch_handle_qxfer_pkt(char *remcom_in_buffer,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/kernel/kgdb.c:323:5: warning: no previous prototype for 'kgdb_riscv_kgdbbreak' [-Wmissing-prototypes]
323 | int kgdb_riscv_kgdbbreak(unsigned long addr)
| ^~~~~~~~~~~~~~~~~~~~
In file included from arch/riscv/include/asm/kgdb.h:109,
from include/linux/kgdb.h:20,
from arch/riscv/kernel/kgdb.c:9:
arch/riscv/include/asm/gdb_xml.h:7:19: warning: 'riscv_gdb_stub_feature' defined but not used [-Wunused-const-variable=]
7 | static const char riscv_gdb_stub_feature[64] =
| ^~~~~~~~~~~~~~~~~~~~~~
vim +/decode_register_index_short +52 arch/riscv/kernel/kgdb.c
46
> 47 int decode_register_index(unsigned long opcode, int offset)
48 {
49 return (opcode >> offset) & 0x1F;
50 }
51
> 52 int decode_register_index_short(unsigned long opcode, int offset)
53 {
54 return ((opcode >> offset) & 0x7) + 8;
55 }
56
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[djwong-xfs:djwong-wtf 224/234] fs/xfs/xfs_swaprange.c:202:12: warning: variable 'temp_blks' set but not used
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git djwong-wtf
head: dc36d6ffb18ee08b34171a9355b844bbd4534baa
commit: f3744d427b4da5d427216e5be41f7eac9c59c5ce [224/234] xfs: remove old swap extents implementation
config: parisc-randconfig-r005-20200524 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout f3744d427b4da5d427216e5be41f7eac9c59c5ce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/mm.h:95,
from fs/xfs/kmem.h:11,
from fs/xfs/xfs_linux.h:24,
from fs/xfs/xfs.h:22,
from fs/xfs/xfs_swaprange.c:11:
include/asm-generic/pgtable.h: In function 'pte_clear_not_present_full':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 | pte_t old_pte; | ^~~~~~~
arch/parisc/include/asm/pgtable.h:322:34: note: in expansion of macro 'set_pte_at'
322 | #define pte_clear(mm, addr, xp) set_pte_at(mm, addr, xp, __pte(0))
| ^~~~~~~~~~
include/asm-generic/pgtable.h:202:2: note: in expansion of macro 'pte_clear'
202 | pte_clear(mm, address, ptep);
| ^~~~~~~~~
include/asm-generic/pgtable.h: In function '__ptep_modify_prot_commit':
arch/parisc/include/asm/pgtable.h:96:9: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
96 | pte_t old_pte; | ^~~~~~~
include/asm-generic/pgtable.h:641:2: note: in expansion of macro 'set_pte_at'
641 | set_pte_at(vma->vm_mm, addr, ptep, pte);
| ^~~~~~~~~~
fs/xfs/xfs_swaprange.c: In function 'xfs_swap_extent_forks':
>> fs/xfs/xfs_swaprange.c:202:12: warning: variable 'temp_blks' set but not used [-Wunused-but-set-variable]
202 | int64_t temp_blks;
| ^~~~~~~~~
vim +/temp_blks +202 fs/xfs/xfs_swaprange.c
191
192 /* Swap the extents of two files by swapping data forks. */
193 static int
194 xfs_swap_extent_forks(
195 struct xfs_trans **tpp,
196 struct xfs_swapext_req *req)
197 {
198 struct xfs_inode *ip = req->ip1;
199 struct xfs_inode *tip = req->ip2;
200 xfs_filblks_t aforkblks = 0;
201 xfs_filblks_t taforkblks = 0;
> 202 int64_t temp_blks;
203 xfs_extnum_t junk;
204 uint64_t tmp;
205 unsigned int reflink_state;
206 int src_log_flags = XFS_ILOG_CORE;
207 int target_log_flags = XFS_ILOG_CORE;
208 int error;
209
210 reflink_state = xfs_swapext_reflink_prep(req);
211
212 /*
213 * Count the number of extended attribute blocks
214 */
215 if ( ((XFS_IFORK_Q(ip) != 0) && (ip->i_d.di_anextents > 0)) &&
216 (ip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)) {
217 error = xfs_bmap_count_blocks(*tpp, ip, XFS_ATTR_FORK, &junk,
218 &aforkblks);
219 if (error)
220 return error;
221 }
222 if ( ((XFS_IFORK_Q(tip) != 0) && (tip->i_d.di_anextents > 0)) &&
223 (tip->i_d.di_aformat != XFS_DINODE_FMT_LOCAL)) {
224 error = xfs_bmap_count_blocks(*tpp, tip, XFS_ATTR_FORK, &junk,
225 &taforkblks);
226 if (error)
227 return error;
228 }
229
230 /*
231 * Btree format (v3) inodes have the inode number stamped in the bmbt
232 * block headers. We can't start changing the bmbt blocks until the
233 * inode owner change is logged so recovery does the right thing in the
234 * event of a crash. Set the owner change log flags now and leave the
235 * bmbt scan as the last step.
236 */
237 if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
238 if (ip->i_d.di_format == XFS_DINODE_FMT_BTREE)
239 target_log_flags |= XFS_ILOG_DOWNER;
240 if (tip->i_d.di_format == XFS_DINODE_FMT_BTREE)
241 src_log_flags |= XFS_ILOG_DOWNER;
242 }
243
244 /*
245 * Swap the data forks of the inodes
246 */
247 swap(ip->i_df, tip->i_df);
248
249 /* Update quota accounting. */
250 temp_blks = tip->i_d.di_nblocks - taforkblks + aforkblks;
251 xfs_trans_mod_dquot_byino(*tpp, ip, XFS_TRANS_DQ_BCOUNT,
252 temp_blks - ip->i_d.di_nblocks);
253
254 temp_blks = ip->i_d.di_nblocks + taforkblks - aforkblks;
255 xfs_trans_mod_dquot_byino(*tpp, tip, XFS_TRANS_DQ_BCOUNT,
256 temp_blks - tip->i_d.di_nblocks);
257
258 /*
259 * Fix the on-disk inode values
260 */
261 tmp = (uint64_t)ip->i_d.di_nblocks;
262 ip->i_d.di_nblocks = tip->i_d.di_nblocks - taforkblks + aforkblks;
263 tip->i_d.di_nblocks = tmp + taforkblks - aforkblks;
264
265 swap(ip->i_d.di_nextents, tip->i_d.di_nextents);
266 swap(ip->i_d.di_format, tip->i_d.di_format);
267
268 /*
269 * The extents in the source inode could still contain speculative
270 * preallocation beyond EOF (e.g. the file is open but not modified
271 * while defrag is in progress). In that case, we need to copy over the
272 * number of delalloc blocks the data fork in the source inode is
273 * tracking beyond EOF so that when the fork is truncated away when the
274 * temporary inode is unlinked we don't underrun the i_delayed_blks
275 * counter on that inode.
276 */
277 ASSERT(tip->i_delayed_blks == 0);
278 tip->i_delayed_blks = ip->i_delayed_blks;
279 ip->i_delayed_blks = 0;
280
281 switch (ip->i_d.di_format) {
282 case XFS_DINODE_FMT_EXTENTS:
283 src_log_flags |= XFS_ILOG_DEXT;
284 break;
285 case XFS_DINODE_FMT_BTREE:
286 ASSERT(!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb) ||
287 (src_log_flags & XFS_ILOG_DOWNER));
288 src_log_flags |= XFS_ILOG_DBROOT;
289 break;
290 }
291
292 switch (tip->i_d.di_format) {
293 case XFS_DINODE_FMT_EXTENTS:
294 target_log_flags |= XFS_ILOG_DEXT;
295 break;
296 case XFS_DINODE_FMT_BTREE:
297 target_log_flags |= XFS_ILOG_DBROOT;
298 ASSERT(!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb) ||
299 (target_log_flags & XFS_ILOG_DOWNER));
300 break;
301 }
302
303 xfs_swapext_reflink_finish(*tpp, req, reflink_state);
304
305 xfs_trans_log_inode(*tpp, ip, src_log_flags);
306 xfs_trans_log_inode(*tpp, tip, target_log_flags);
307
308 /*
309 * The extent forks have been swapped, but crc=1,rmapbt=0 filesystems
310 * have inode number owner values in the bmbt blocks that still refer to
311 * the old inode. Scan each bmbt to fix up the owner values with the
312 * inode number of the current inode.
313 */
314 if (src_log_flags & XFS_ILOG_DOWNER) {
315 error = xfs_swap_change_owner(tpp, ip, tip);
316 if (error)
317 return error;
318 }
319 if (target_log_flags & XFS_ILOG_DOWNER) {
320 error = xfs_swap_change_owner(tpp, tip, ip);
321 if (error)
322 return error;
323 }
324
325 return 0;
326 }
327
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v13 2/3] i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver
by kbuild test robot
Hi Tali,
I love your patch! Yet something to improve:
[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on v5.7-rc6 next-20200522]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Tali-Perry/i2c-npcm7xx-add-NPCM-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: x86_64-allmodconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/i2c/busses/i2c-npcm7xx.c:1797:1: error: redefinition of '__inittest'
module_init(npcm_i2c_init);
^
include/linux/module.h:131:42: note: expanded from macro 'module_init'
static inline initcall_t __maybe_unused __inittest(void) ^
drivers/i2c/busses/i2c-npcm7xx.c:1778:1: note: previous definition is here
module_platform_driver(npcm_i2c_bus_driver);
^
include/linux/platform_device.h:247:2: note: expanded from macro 'module_platform_driver'
module_driver(__platform_driver, platform_driver_register, ^
include/linux/device/driver.h:262:3: note: expanded from macro 'module_driver'
} ^
include/linux/module.h:131:42: note: expanded from macro ' module_init'
static inline initcall_t __maybe_unused __inittest(void) ^
>> drivers/i2c/busses/i2c-npcm7xx.c:1797:1: error: redefinition of 'init_module'
module_init(npcm_i2c_init);
^
include/linux/module.h:133:6: note: expanded from macro 'module_init'
int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
^
drivers/i2c/busses/i2c-npcm7xx.c:1778:1: note: previous definition is here
module_platform_driver(npcm_i2c_bus_driver);
^
include/linux/platform_device.h:247:2: note: expanded from macro 'module_platform_driver'
module_driver(__platform_driver, platform_driver_register, ^
include/linux/device/driver.h:262:3: note: expanded from macro 'module_driver'
} ^
include/linux/module.h:133:6: note: expanded from macro ' module_init'
int init_module(void) __copy(initfn) __attribute__((alias(#initfn)));
^
>> drivers/i2c/busses/i2c-npcm7xx.c:1798:1: error: redefinition of '__exittest'
module_exit(npcm_i2c_exit);
^
include/linux/module.h:137:42: note: expanded from macro 'module_exit'
static inline exitcall_t __maybe_unused __exittest(void) ^
drivers/i2c/busses/i2c-npcm7xx.c:1778:1: note: previous definition is here
module_platform_driver(npcm_i2c_bus_driver);
^
include/linux/platform_device.h:247:2: note: expanded from macro 'module_platform_driver'
module_driver(__platform_driver, platform_driver_register, ^
include/linux/device/driver.h:267:3: note: expanded from macro 'module_driver'
} ^
include/linux/module.h:137:42: note: expanded from macro ' module_exit'
static inline exitcall_t __maybe_unused __exittest(void) ^
>> drivers/i2c/busses/i2c-npcm7xx.c:1798:1: error: redefinition of 'cleanup_module'
module_exit(npcm_i2c_exit);
^
include/linux/module.h:139:7: note: expanded from macro 'module_exit'
void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));
^
drivers/i2c/busses/i2c-npcm7xx.c:1778:1: note: previous definition is here
module_platform_driver(npcm_i2c_bus_driver);
^
include/linux/platform_device.h:247:2: note: expanded from macro 'module_platform_driver'
module_driver(__platform_driver, platform_driver_register, ^
include/linux/device/driver.h:267:3: note: expanded from macro 'module_driver'
} ^
include/linux/module.h:139:7: note: expanded from macro ' module_exit'
void cleanup_module(void) __copy(exitfn) __attribute__((alias(#exitfn)));
^
4 errors generated.
vim +/__inittest +1797 drivers/i2c/busses/i2c-npcm7xx.c
1796
> 1797 module_init(npcm_i2c_init);
> 1798 module_exit(npcm_i2c_exit);
1799
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1680: undefined reference to `devm_ioremap_resource'
by kbuild test robot
Hi Brendan,
It's probably a bug fix that unveils the link errors.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: caffb99b6929f41a69edbb5aef3a359bf45f3315
commit: 0e31e3573f0cd94d7b821117db854187ffc85765 lkdtm/bugs: fix build error in lkdtm_UNSET_SMEP
date: 4 months ago
config: um-randconfig-s001-20200524 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-193-gb8fad4bc-dirty
git checkout 0e31e3573f0cd94d7b821117db854187ffc85765
# save the attached .config to linux build tree
make W=1 C=1 ARCH=um CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
/usr/bin/ld: drivers/net/ethernet/xilinx/xilinx_axienet_main.o: in function `axienet_probe':
>> drivers/net/ethernet/xilinx/xilinx_axienet_main.c:1680: undefined reference to `devm_ioremap_resource'
collect2: error: ld returned 1 exit status
vim +1680 drivers/net/ethernet/xilinx/xilinx_axienet_main.c
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1633
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1634 /**
2be586205ca2b8 Srikanth Thokala 2015-05-05 1635 * axienet_probe - Axi Ethernet probe function.
95219aa538e11d Srikanth Thokala 2015-05-05 1636 * @pdev: Pointer to platform device structure.
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1637 *
b0d081c524b46c Michal Simek 2015-05-05 1638 * Return: 0, on success
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1639 * Non-zero error value on failure.
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1640 *
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1641 * This is the probe routine for Axi Ethernet driver. This is called before
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1642 * any other driver routines are invoked. It allocates and sets up the Ethernet
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1643 * device. Parses through device tree and populates fields of
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1644 * axienet_local. It registers the Ethernet device.
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1645 */
2be586205ca2b8 Srikanth Thokala 2015-05-05 1646 static int axienet_probe(struct platform_device *pdev)
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1647 {
8495659bf93c8e Srikanth Thokala 2015-05-05 1648 int ret;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1649 struct device_node *np;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1650 struct axienet_local *lp;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1651 struct net_device *ndev;
da90e38003e2f0 Tobias Klauser 2016-12-07 1652 const void *mac_addr;
28ef9ebdb64c6f Robert Hancock 2019-06-06 1653 struct resource *ethres;
8495659bf93c8e Srikanth Thokala 2015-05-05 1654 u32 value;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1655
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1656 ndev = alloc_etherdev(sizeof(*lp));
41de8d4cff21a2 Joe Perches 2012-01-29 1657 if (!ndev)
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1658 return -ENOMEM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1659
95219aa538e11d Srikanth Thokala 2015-05-05 1660 platform_set_drvdata(pdev, ndev);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1661
95219aa538e11d Srikanth Thokala 2015-05-05 1662 SET_NETDEV_DEV(ndev, &pdev->dev);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1663 ndev->flags &= ~IFF_MULTICAST; /* clear multicast */
28e24c62ab3062 Eric Dumazet 2013-12-02 1664 ndev->features = NETIF_F_SG;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1665 ndev->netdev_ops = &axienet_netdev_ops;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1666 ndev->ethtool_ops = &axienet_ethtool_ops;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1667
d894be57ca92c8 Jarod Wilson 2016-10-20 1668 /* MTU range: 64 - 9000 */
d894be57ca92c8 Jarod Wilson 2016-10-20 1669 ndev->min_mtu = 64;
d894be57ca92c8 Jarod Wilson 2016-10-20 1670 ndev->max_mtu = XAE_JUMBO_MTU;
d894be57ca92c8 Jarod Wilson 2016-10-20 1671
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1672 lp = netdev_priv(ndev);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1673 lp->ndev = ndev;
95219aa538e11d Srikanth Thokala 2015-05-05 1674 lp->dev = &pdev->dev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1675 lp->options = XAE_OPTION_DEFAULTS;
8b09ca823ffb4e Robert Hancock 2019-06-06 1676 lp->rx_bd_num = RX_BD_NUM_DEFAULT;
8b09ca823ffb4e Robert Hancock 2019-06-06 1677 lp->tx_bd_num = TX_BD_NUM_DEFAULT;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1678 /* Map device registers */
46aa27df885321 Srikanth Thokala 2015-05-05 1679 ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
46aa27df885321 Srikanth Thokala 2015-05-05 @1680 lp->regs = devm_ioremap_resource(&pdev->dev, ethres);
fcc028c106e575 Krzysztof Kozlowski 2015-07-09 1681 if (IS_ERR(lp->regs)) {
95219aa538e11d Srikanth Thokala 2015-05-05 1682 dev_err(&pdev->dev, "could not map Axi Ethernet regs.\n");
fcc028c106e575 Krzysztof Kozlowski 2015-07-09 1683 ret = PTR_ERR(lp->regs);
46aa27df885321 Srikanth Thokala 2015-05-05 1684 goto free_netdev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1685 }
7fa0043d5c74c6 Robert Hancock 2019-06-11 1686 lp->regs_start = ethres->start;
46aa27df885321 Srikanth Thokala 2015-05-05 1687
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1688 /* Setup checksum offload, but default to off if not specified */
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1689 lp->features = 0;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1690
8495659bf93c8e Srikanth Thokala 2015-05-05 1691 ret = of_property_read_u32(pdev->dev.of_node, "xlnx,txcsum", &value);
8495659bf93c8e Srikanth Thokala 2015-05-05 1692 if (!ret) {
8495659bf93c8e Srikanth Thokala 2015-05-05 1693 switch (value) {
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1694 case 1:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1695 lp->csum_offload_on_tx_path =
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1696 XAE_FEATURE_PARTIAL_TX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1697 lp->features |= XAE_FEATURE_PARTIAL_TX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1698 /* Can checksum TCP/UDP over IPv4. */
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1699 ndev->features |= NETIF_F_IP_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1700 break;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1701 case 2:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1702 lp->csum_offload_on_tx_path =
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1703 XAE_FEATURE_FULL_TX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1704 lp->features |= XAE_FEATURE_FULL_TX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1705 /* Can checksum TCP/UDP over IPv4. */
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1706 ndev->features |= NETIF_F_IP_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1707 break;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1708 default:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1709 lp->csum_offload_on_tx_path = XAE_NO_CSUM_OFFLOAD;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1710 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1711 }
8495659bf93c8e Srikanth Thokala 2015-05-05 1712 ret = of_property_read_u32(pdev->dev.of_node, "xlnx,rxcsum", &value);
8495659bf93c8e Srikanth Thokala 2015-05-05 1713 if (!ret) {
8495659bf93c8e Srikanth Thokala 2015-05-05 1714 switch (value) {
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1715 case 1:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1716 lp->csum_offload_on_rx_path =
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1717 XAE_FEATURE_PARTIAL_RX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1718 lp->features |= XAE_FEATURE_PARTIAL_RX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1719 break;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1720 case 2:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1721 lp->csum_offload_on_rx_path =
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1722 XAE_FEATURE_FULL_RX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1723 lp->features |= XAE_FEATURE_FULL_RX_CSUM;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1724 break;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1725 default:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1726 lp->csum_offload_on_rx_path = XAE_NO_CSUM_OFFLOAD;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1727 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1728 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1729 /* For supporting jumbo frames, the Axi Ethernet hardware must have
f080a8c35d8932 Srikanth Thokala 2015-05-05 1730 * a larger Rx/Tx Memory. Typically, the size must be large so that
f080a8c35d8932 Srikanth Thokala 2015-05-05 1731 * we can enable jumbo option and start supporting jumbo frames.
f080a8c35d8932 Srikanth Thokala 2015-05-05 1732 * Here we check for memory allocated for Rx/Tx in the hardware from
f080a8c35d8932 Srikanth Thokala 2015-05-05 1733 * the device-tree and accordingly set flags.
f080a8c35d8932 Srikanth Thokala 2015-05-05 1734 */
8495659bf93c8e Srikanth Thokala 2015-05-05 1735 of_property_read_u32(pdev->dev.of_node, "xlnx,rxmem", &lp->rxmem);
ee06b1728b9564 Alvaro G. M 2017-07-17 1736
ee06b1728b9564 Alvaro G. M 2017-07-17 1737 /* Start with the proprietary, and broken phy_type */
ee06b1728b9564 Alvaro G. M 2017-07-17 1738 ret = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &value);
ee06b1728b9564 Alvaro G. M 2017-07-17 1739 if (!ret) {
ee06b1728b9564 Alvaro G. M 2017-07-17 1740 netdev_warn(ndev, "Please upgrade your device tree binary blob to use phy-mode");
ee06b1728b9564 Alvaro G. M 2017-07-17 1741 switch (value) {
ee06b1728b9564 Alvaro G. M 2017-07-17 1742 case XAE_PHY_TYPE_MII:
ee06b1728b9564 Alvaro G. M 2017-07-17 1743 lp->phy_mode = PHY_INTERFACE_MODE_MII;
ee06b1728b9564 Alvaro G. M 2017-07-17 1744 break;
ee06b1728b9564 Alvaro G. M 2017-07-17 1745 case XAE_PHY_TYPE_GMII:
ee06b1728b9564 Alvaro G. M 2017-07-17 1746 lp->phy_mode = PHY_INTERFACE_MODE_GMII;
ee06b1728b9564 Alvaro G. M 2017-07-17 1747 break;
ee06b1728b9564 Alvaro G. M 2017-07-17 1748 case XAE_PHY_TYPE_RGMII_2_0:
ee06b1728b9564 Alvaro G. M 2017-07-17 1749 lp->phy_mode = PHY_INTERFACE_MODE_RGMII_ID;
ee06b1728b9564 Alvaro G. M 2017-07-17 1750 break;
ee06b1728b9564 Alvaro G. M 2017-07-17 1751 case XAE_PHY_TYPE_SGMII:
ee06b1728b9564 Alvaro G. M 2017-07-17 1752 lp->phy_mode = PHY_INTERFACE_MODE_SGMII;
ee06b1728b9564 Alvaro G. M 2017-07-17 1753 break;
ee06b1728b9564 Alvaro G. M 2017-07-17 1754 case XAE_PHY_TYPE_1000BASE_X:
ee06b1728b9564 Alvaro G. M 2017-07-17 1755 lp->phy_mode = PHY_INTERFACE_MODE_1000BASEX;
ee06b1728b9564 Alvaro G. M 2017-07-17 1756 break;
ee06b1728b9564 Alvaro G. M 2017-07-17 1757 default:
ee06b1728b9564 Alvaro G. M 2017-07-17 1758 ret = -EINVAL;
ee06b1728b9564 Alvaro G. M 2017-07-17 1759 goto free_netdev;
ee06b1728b9564 Alvaro G. M 2017-07-17 1760 }
ee06b1728b9564 Alvaro G. M 2017-07-17 1761 } else {
0c65b2b90d13c1 Andrew Lunn 2019-11-04 1762 ret = of_get_phy_mode(pdev->dev.of_node, &lp->phy_mode);
0c65b2b90d13c1 Andrew Lunn 2019-11-04 1763 if (ret)
ee06b1728b9564 Alvaro G. M 2017-07-17 1764 goto free_netdev;
ee06b1728b9564 Alvaro G. M 2017-07-17 1765 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1766
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1767 /* Find the DMA node, map the DMA registers, and decode the DMA IRQs */
95219aa538e11d Srikanth Thokala 2015-05-05 1768 np = of_parse_phandle(pdev->dev.of_node, "axistream-connected", 0);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1769 if (np) {
28ef9ebdb64c6f Robert Hancock 2019-06-06 1770 struct resource dmares;
28ef9ebdb64c6f Robert Hancock 2019-06-06 1771
46aa27df885321 Srikanth Thokala 2015-05-05 1772 ret = of_address_to_resource(np, 0, &dmares);
46aa27df885321 Srikanth Thokala 2015-05-05 1773 if (ret) {
28ef9ebdb64c6f Robert Hancock 2019-06-06 1774 dev_err(&pdev->dev,
28ef9ebdb64c6f Robert Hancock 2019-06-06 1775 "unable to get DMA resource\n");
fa3a419d2f674b Wen Yang 2019-03-22 1776 of_node_put(np);
46aa27df885321 Srikanth Thokala 2015-05-05 1777 goto free_netdev;
46aa27df885321 Srikanth Thokala 2015-05-05 1778 }
28ef9ebdb64c6f Robert Hancock 2019-06-06 1779 lp->dma_regs = devm_ioremap_resource(&pdev->dev,
28ef9ebdb64c6f Robert Hancock 2019-06-06 1780 &dmares);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1781 lp->rx_irq = irq_of_parse_and_map(np, 1);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1782 lp->tx_irq = irq_of_parse_and_map(np, 0);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1783 of_node_put(np);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1784 lp->eth_irq = platform_get_irq(pdev, 0);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1785 } else {
28ef9ebdb64c6f Robert Hancock 2019-06-06 1786 /* Check for these resources directly on the Ethernet node. */
28ef9ebdb64c6f Robert Hancock 2019-06-06 1787 struct resource *res = platform_get_resource(pdev,
28ef9ebdb64c6f Robert Hancock 2019-06-06 1788 IORESOURCE_MEM, 1);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1789 lp->dma_regs = devm_ioremap_resource(&pdev->dev, res);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1790 lp->rx_irq = platform_get_irq(pdev, 1);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1791 lp->tx_irq = platform_get_irq(pdev, 0);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1792 lp->eth_irq = platform_get_irq(pdev, 2);
28ef9ebdb64c6f Robert Hancock 2019-06-06 1793 }
fcc028c106e575 Krzysztof Kozlowski 2015-07-09 1794 if (IS_ERR(lp->dma_regs)) {
46aa27df885321 Srikanth Thokala 2015-05-05 1795 dev_err(&pdev->dev, "could not map DMA regs\n");
fcc028c106e575 Krzysztof Kozlowski 2015-07-09 1796 ret = PTR_ERR(lp->dma_regs);
46aa27df885321 Srikanth Thokala 2015-05-05 1797 goto free_netdev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1798 }
cb59c87dbc8be2 Michal Simek 2013-01-10 1799 if ((lp->rx_irq <= 0) || (lp->tx_irq <= 0)) {
95219aa538e11d Srikanth Thokala 2015-05-05 1800 dev_err(&pdev->dev, "could not determine irqs\n");
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1801 ret = -ENOMEM;
46aa27df885321 Srikanth Thokala 2015-05-05 1802 goto free_netdev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1803 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1804
522856cefaf09d Robert Hancock 2019-06-06 1805 /* Check for Ethernet core IRQ (optional) */
522856cefaf09d Robert Hancock 2019-06-06 1806 if (lp->eth_irq <= 0)
522856cefaf09d Robert Hancock 2019-06-06 1807 dev_info(&pdev->dev, "Ethernet core IRQ not defined\n");
522856cefaf09d Robert Hancock 2019-06-06 1808
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1809 /* Retrieve the MAC address */
da90e38003e2f0 Tobias Klauser 2016-12-07 1810 mac_addr = of_get_mac_address(pdev->dev.of_node);
a51645f70f6384 Petr Štetiar 2019-05-06 1811 if (IS_ERR(mac_addr)) {
d05a9ed5c3a773 Robert Hancock 2019-06-06 1812 dev_warn(&pdev->dev, "could not find MAC address property: %ld\n",
d05a9ed5c3a773 Robert Hancock 2019-06-06 1813 PTR_ERR(mac_addr));
d05a9ed5c3a773 Robert Hancock 2019-06-06 1814 mac_addr = NULL;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1815 }
da90e38003e2f0 Tobias Klauser 2016-12-07 1816 axienet_set_mac_address(ndev, mac_addr);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1817
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1818 lp->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1819 lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1820
95219aa538e11d Srikanth Thokala 2015-05-05 1821 lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
46aa27df885321 Srikanth Thokala 2015-05-05 1822 if (lp->phy_node) {
09a0354cadec26 Robert Hancock 2019-06-06 1823 lp->clk = devm_clk_get(&pdev->dev, NULL);
09a0354cadec26 Robert Hancock 2019-06-06 1824 if (IS_ERR(lp->clk)) {
09a0354cadec26 Robert Hancock 2019-06-06 1825 dev_warn(&pdev->dev, "Failed to get clock: %ld\n",
09a0354cadec26 Robert Hancock 2019-06-06 1826 PTR_ERR(lp->clk));
09a0354cadec26 Robert Hancock 2019-06-06 1827 lp->clk = NULL;
09a0354cadec26 Robert Hancock 2019-06-06 1828 } else {
09a0354cadec26 Robert Hancock 2019-06-06 1829 ret = clk_prepare_enable(lp->clk);
09a0354cadec26 Robert Hancock 2019-06-06 1830 if (ret) {
09a0354cadec26 Robert Hancock 2019-06-06 1831 dev_err(&pdev->dev, "Unable to enable clock: %d\n",
09a0354cadec26 Robert Hancock 2019-06-06 1832 ret);
09a0354cadec26 Robert Hancock 2019-06-06 1833 goto free_netdev;
09a0354cadec26 Robert Hancock 2019-06-06 1834 }
09a0354cadec26 Robert Hancock 2019-06-06 1835 }
09a0354cadec26 Robert Hancock 2019-06-06 1836
09a0354cadec26 Robert Hancock 2019-06-06 1837 ret = axienet_mdio_setup(lp);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1838 if (ret)
09a0354cadec26 Robert Hancock 2019-06-06 1839 dev_warn(&pdev->dev,
09a0354cadec26 Robert Hancock 2019-06-06 1840 "error registering MDIO bus: %d\n", ret);
46aa27df885321 Srikanth Thokala 2015-05-05 1841 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1842
f5203a3d9b25fa Robert Hancock 2019-06-06 1843 lp->phylink_config.dev = &ndev->dev;
f5203a3d9b25fa Robert Hancock 2019-06-06 1844 lp->phylink_config.type = PHYLINK_NETDEV;
f5203a3d9b25fa Robert Hancock 2019-06-06 1845
f5203a3d9b25fa Robert Hancock 2019-06-06 1846 lp->phylink = phylink_create(&lp->phylink_config, pdev->dev.fwnode,
f5203a3d9b25fa Robert Hancock 2019-06-06 1847 lp->phy_mode,
f5203a3d9b25fa Robert Hancock 2019-06-06 1848 &axienet_phylink_ops);
f5203a3d9b25fa Robert Hancock 2019-06-06 1849 if (IS_ERR(lp->phylink)) {
f5203a3d9b25fa Robert Hancock 2019-06-06 1850 ret = PTR_ERR(lp->phylink);
f5203a3d9b25fa Robert Hancock 2019-06-06 1851 dev_err(&pdev->dev, "phylink_create error (%i)\n", ret);
f5203a3d9b25fa Robert Hancock 2019-06-06 1852 goto free_netdev;
f5203a3d9b25fa Robert Hancock 2019-06-06 1853 }
f5203a3d9b25fa Robert Hancock 2019-06-06 1854
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1855 ret = register_netdev(lp->ndev);
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1856 if (ret) {
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1857 dev_err(lp->dev, "register_netdev() error (%i)\n", ret);
46aa27df885321 Srikanth Thokala 2015-05-05 1858 goto free_netdev;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1859 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1860
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1861 return 0;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1862
46aa27df885321 Srikanth Thokala 2015-05-05 1863 free_netdev:
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1864 free_netdev(ndev);
46aa27df885321 Srikanth Thokala 2015-05-05 1865
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1866 return ret;
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1867 }
8a3b7a252dca9f Daniel Borkmann 2012-01-19 1868
:::::: The code at line 1680 was first introduced by commit
:::::: 46aa27df88532146974628602b6f5cc587422388 net: axienet: Use devm_* calls
:::::: TO: Srikanth Thokala <srikanth.thokala(a)xilinx.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 3008/12102] sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c11d28ab4a691736e30b49813fb801847bd44e83
commit: be7bd03f0201b5a513ced98c08444a140eab92ea [3008/12102] ASoC: fsl_asrc: Move common definition to fsl_asrc_common
config: x86_64-randconfig-a004-20200524 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout be7bd03f0201b5a513ced98c08444a140eab92ea
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
sound/soc/fsl/fsl_asrc.c:157:5: warning: no previous prototype for function 'fsl_asrc_request_pair' [-Wmissing-prototypes]
int fsl_asrc_request_pair(int channels, struct fsl_asrc_pair *pair)
^
sound/soc/fsl/fsl_asrc.c:157:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int fsl_asrc_request_pair(int channels, struct fsl_asrc_pair *pair)
^
static
sound/soc/fsl/fsl_asrc.c:200:6: warning: no previous prototype for function 'fsl_asrc_release_pair' [-Wmissing-prototypes]
void fsl_asrc_release_pair(struct fsl_asrc_pair *pair)
^
sound/soc/fsl/fsl_asrc.c:200:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void fsl_asrc_release_pair(struct fsl_asrc_pair *pair)
^
static
>> sound/soc/fsl/fsl_asrc.c:557:18: warning: no previous prototype for function 'fsl_asrc_get_dma_channel' [-Wmissing-prototypes]
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
^
sound/soc/fsl/fsl_asrc.c:557:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
^
static
3 warnings generated.
vim +/fsl_asrc_get_dma_channel +557 sound/soc/fsl/fsl_asrc.c
3117bb3109dc223 Nicolin Chen 2014-07-29 553
3117bb3109dc223 Nicolin Chen 2014-07-29 554 /**
3117bb3109dc223 Nicolin Chen 2014-07-29 555 * Get DMA channel according to the pair and direction.
3117bb3109dc223 Nicolin Chen 2014-07-29 556 */
3117bb3109dc223 Nicolin Chen 2014-07-29 @557 struct dma_chan *fsl_asrc_get_dma_channel(struct fsl_asrc_pair *pair, bool dir)
3117bb3109dc223 Nicolin Chen 2014-07-29 558 {
7470704d8b425c4 Shengjiu Wang 2020-04-16 559 struct fsl_asrc *asrc = pair->asrc;
3117bb3109dc223 Nicolin Chen 2014-07-29 560 enum asrc_pair_index index = pair->index;
3117bb3109dc223 Nicolin Chen 2014-07-29 561 char name[4];
3117bb3109dc223 Nicolin Chen 2014-07-29 562
3117bb3109dc223 Nicolin Chen 2014-07-29 563 sprintf(name, "%cx%c", dir == IN ? 'r' : 't', index + 'a');
3117bb3109dc223 Nicolin Chen 2014-07-29 564
7470704d8b425c4 Shengjiu Wang 2020-04-16 565 return dma_request_slave_channel(&asrc->pdev->dev, name);
3117bb3109dc223 Nicolin Chen 2014-07-29 566 }
3117bb3109dc223 Nicolin Chen 2014-07-29 567 EXPORT_SYMBOL_GPL(fsl_asrc_get_dma_channel);
3117bb3109dc223 Nicolin Chen 2014-07-29 568
:::::: The code at line 557 was first introduced by commit
:::::: 3117bb3109dc223e186302f5dc8ce9ed04adca90 ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers
:::::: TO: Nicolin Chen <nicoleotsuka(a)gmail.com>
:::::: CC: Mark Brown <broonie(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[jkirsher-next-queue:dev-queue 50/99] drivers/net/ethernet/intel/ice/ice_base.c:421:39: error: 'struct xdp_umem' has no member named 'chunk_size_nohr'; did you mean 'chunk_size'?
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
head: 5950d1e508b225372208a78339e6434adf129852
commit: 307e0c99a4576106e2fb77e73ae82b514a3fd8ce [50/99] ice: Refactor ice_setup_rx_ctx
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
git checkout 307e0c99a4576106e2fb77e73ae82b514a3fd8ce
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/intel/ice/ice_base.c: In function 'ice_vsi_cfg_rxq':
>> drivers/net/ethernet/intel/ice/ice_base.c:421:39: error: 'struct xdp_umem' has no member named 'chunk_size_nohr'; did you mean 'chunk_size'?
ring->rx_buf_len = ring->xsk_umem->chunk_size_nohr -
^~~~~~~~~~~~~~~
chunk_size
>> drivers/net/ethernet/intel/ice/ice_base.c:423:8: error: 'struct ice_ring' has no member named 'zca'
ring->zca.free = ice_zca_free;
^~
>> drivers/net/ethernet/intel/ice/ice_base.c:423:21: error: 'ice_zca_free' undeclared (first use in this function); did you mean 'ice_get_res'?
ring->zca.free = ice_zca_free;
^~~~~~~~~~~~
ice_get_res
drivers/net/ethernet/intel/ice/ice_base.c:423:21: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/net/ethernet/intel/ice/ice_base.c:425:9: error: 'MEM_TYPE_ZERO_COPY' undeclared (first use in this function); did you mean 'MEM_TYPE_PAGE_POOL'?
MEM_TYPE_ZERO_COPY,
^~~~~~~~~~~~~~~~~~
MEM_TYPE_PAGE_POOL
drivers/net/ethernet/intel/ice/ice_base.c:426:14: error: 'struct ice_ring' has no member named 'zca'
&ring->zca);
^~
drivers/net/ethernet/intel/ice/ice_base.c:433:8: error: 'struct ice_ring' has no member named 'zca'
ring->zca.free = NULL;
^~
drivers/net/ethernet/intel/ice/ice_base.c:456:8: error: implicit declaration of function 'xsk_umem_has_addrs_rq'; did you mean 'xsk_umem_get_headroom'? [-Werror=implicit-function-declaration]
if (!xsk_umem_has_addrs_rq(ring->xsk_umem, num_bufs)) {
^~~~~~~~~~~~~~~~~~~~~
xsk_umem_get_headroom
drivers/net/ethernet/intel/ice/ice_base.c:464:9: error: implicit declaration of function 'ice_alloc_rx_bufs_slow_zc'; did you mean 'ice_alloc_rx_bufs_zc'? [-Werror=implicit-function-declaration]
err = ice_alloc_rx_bufs_slow_zc(ring, num_bufs);
^~~~~~~~~~~~~~~~~~~~~~~~~
ice_alloc_rx_bufs_zc
cc1: some warnings being treated as errors
vim +421 drivers/net/ethernet/intel/ice/ice_base.c
396
397 /**
398 * ice_vsi_cfg_rxq - Configure an Rx queue
399 * @ring: the ring being configured
400 *
401 * Return 0 on success and a negative value on error.
402 */
403 int ice_vsi_cfg_rxq(struct ice_ring *ring)
404 {
405 struct device *dev = ice_pf_to_dev(ring->vsi->back);
406 u16 num_bufs = ICE_DESC_UNUSED(ring);
407 int err;
408
409 ring->rx_buf_len = ring->vsi->rx_buf_len;
410
411 if (ring->vsi->type == ICE_VSI_PF) {
412 if (!xdp_rxq_info_is_reg(&ring->xdp_rxq))
413 /* coverity[check_return] */
414 xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
415 ring->q_index);
416
417 ring->xsk_umem = ice_xsk_umem(ring);
418 if (ring->xsk_umem) {
419 xdp_rxq_info_unreg_mem_model(&ring->xdp_rxq);
420
> 421 ring->rx_buf_len = ring->xsk_umem->chunk_size_nohr -
422 XDP_PACKET_HEADROOM;
> 423 ring->zca.free = ice_zca_free;
424 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
> 425 MEM_TYPE_ZERO_COPY,
426 &ring->zca);
427 if (err)
428 return err;
429
430 dev_info(dev, "Registered XDP mem model MEM_TYPE_ZERO_COPY on Rx ring %d\n",
431 ring->q_index);
432 } else {
433 ring->zca.free = NULL;
434 if (!xdp_rxq_info_is_reg(&ring->xdp_rxq))
435 /* coverity[check_return] */
436 xdp_rxq_info_reg(&ring->xdp_rxq,
437 ring->netdev,
438 ring->q_index);
439
440 err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
441 MEM_TYPE_PAGE_SHARED,
442 NULL);
443 if (err)
444 return err;
445 }
446 }
447
448 err = ice_setup_rx_ctx(ring);
449 if (err) {
450 dev_err(dev, "ice_setup_rx_ctx failed for RxQ %d, err %d\n",
451 ring->q_index, err);
452 return err;
453 }
454
455 if (ring->xsk_umem) {
456 if (!xsk_umem_has_addrs_rq(ring->xsk_umem, num_bufs)) {
457 dev_warn(dev, "UMEM does not provide enough addresses to fill %d buffers on Rx ring %d\n",
458 num_bufs, ring->q_index);
459 dev_warn(dev, "Change Rx ring/fill queue size to avoid performance issues\n");
460
461 return 0;
462 }
463
464 err = ice_alloc_rx_bufs_slow_zc(ring, num_bufs);
465 if (err) {
466 u16 pf_q = ring->vsi->rxq_map[ring->q_index];
467
468 dev_info(dev, "Failed to allocate some buffers on UMEM enabled Rx ring %d (pf_q %d)\n",
469 ring->q_index, pf_q);
470 }
471
472 return 0;
473 }
474
475 ice_alloc_rx_bufs(ring, num_bufs);
476
477 return 0;
478 }
479
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[jkirsher-next-queue:dev-queue 1768/1945] drivers/net/ethernet/mediatek/mtk_star_emac.c:749:29: warning: variable 'desc' set but not used
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git dev-queue
head: 5950d1e508b225372208a78339e6434adf129852
commit: 8c7bd5a454ffc2b0518d1499c4af95f00291d2af [1768/1945] net: ethernet: mtk-star-emac: new driver
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 8c7bd5a454ffc2b0518d1499c4af95f00291d2af
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
drivers/net/ethernet/mediatek/mtk_star_emac.c: In function 'mtk_star_ring_free_skbs':
>> drivers/net/ethernet/mediatek/mtk_star_emac.c:749:29: warning: variable 'desc' set but not used [-Wunused-but-set-variable]
749 | struct mtk_star_ring_desc *desc;
| ^~~~
vim +/desc +749 drivers/net/ethernet/mediatek/mtk_star_emac.c
742
743 static void
744 mtk_star_ring_free_skbs(struct mtk_star_priv *priv, struct mtk_star_ring *ring,
745 void (*unmap_func)(struct mtk_star_priv *,
746 struct mtk_star_ring_desc_data *))
747 {
748 struct mtk_star_ring_desc_data desc_data;
> 749 struct mtk_star_ring_desc *desc;
750 int i;
751
752 for (i = 0; i < MTK_STAR_RING_NUM_DESCS; i++) {
753 if (!ring->dma_addrs[i])
754 continue;
755
756 desc = &ring->descs[i];
757
758 desc_data.dma_addr = ring->dma_addrs[i];
759 desc_data.skb = ring->skbs[i];
760
761 unmap_func(priv, &desc_data);
762 dev_kfree_skb(desc_data.skb);
763 }
764 }
765
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[linux-next:master 4844/12102] drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:5: warning: no previous prototype for function 'bcmgenet_hfb_add_filter'
by kbuild test robot
Hi Doug,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c11d28ab4a691736e30b49813fb801847bd44e83
commit: 14da1510fedc2d72ca81344a0f62939e0a1bc648 [4844/12102] Revert "net: bcmgenet: remove unused function in bcmgenet.c"
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 14da1510fedc2d72ca81344a0f62939e0a1bc648
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:5: warning: no previous prototype for function 'bcmgenet_hfb_add_filter' [-Wmissing-prototypes]
int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
^
drivers/net/ethernet/broadcom/genet/bcmgenet.c:2858:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
^
static
drivers/net/ethernet/broadcom/genet/bcmgenet.c:120:26: warning: unused function 'dmadesc_get_addr' [-Wunused-function]
static inline dma_addr_t dmadesc_get_addr(struct bcmgenet_priv *priv,
^
2 warnings generated.
vim +/bcmgenet_hfb_add_filter +2858 drivers/net/ethernet/broadcom/genet/bcmgenet.c
2822
2823 /* bcmgenet_hfb_add_filter
2824 *
2825 * Add new filter to Hardware Filter Block to match and direct Rx traffic to
2826 * desired Rx queue.
2827 *
2828 * f_data is an array of unsigned 32-bit integers where each 32-bit integer
2829 * provides filter data for 2 bytes (4 nibbles) of Rx frame:
2830 *
2831 * bits 31:20 - unused
2832 * bit 19 - nibble 0 match enable
2833 * bit 18 - nibble 1 match enable
2834 * bit 17 - nibble 2 match enable
2835 * bit 16 - nibble 3 match enable
2836 * bits 15:12 - nibble 0 data
2837 * bits 11:8 - nibble 1 data
2838 * bits 7:4 - nibble 2 data
2839 * bits 3:0 - nibble 3 data
2840 *
2841 * Example:
2842 * In order to match:
2843 * - Ethernet frame type = 0x0800 (IP)
2844 * - IP version field = 4
2845 * - IP protocol field = 0x11 (UDP)
2846 *
2847 * The following filter is needed:
2848 * u32 hfb_filter_ipv4_udp[] = {
2849 * Rx frame offset 0x00: 0x00000000, 0x00000000, 0x00000000, 0x00000000,
2850 * Rx frame offset 0x08: 0x00000000, 0x00000000, 0x000F0800, 0x00084000,
2851 * Rx frame offset 0x10: 0x00000000, 0x00000000, 0x00000000, 0x00030011,
2852 * };
2853 *
2854 * To add the filter to HFB and direct the traffic to Rx queue 0, call:
2855 * bcmgenet_hfb_add_filter(priv, hfb_filter_ipv4_udp,
2856 * ARRAY_SIZE(hfb_filter_ipv4_udp), 0);
2857 */
> 2858 int bcmgenet_hfb_add_filter(struct bcmgenet_priv *priv, u32 *f_data,
2859 u32 f_length, u32 rx_queue)
2860 {
2861 int f_index;
2862 u32 i;
2863
2864 f_index = bcmgenet_hfb_find_unused_filter(priv);
2865 if (f_index < 0)
2866 return -ENOMEM;
2867
2868 if (f_length > priv->hw_params->hfb_filter_size)
2869 return -EINVAL;
2870
2871 for (i = 0; i < f_length; i++)
2872 bcmgenet_hfb_writel(priv, f_data[i],
2873 (f_index * priv->hw_params->hfb_filter_size + i) *
2874 sizeof(u32));
2875
2876 bcmgenet_hfb_set_filter_length(priv, f_index, 2 * f_length);
2877 bcmgenet_hfb_set_filter_rx_queue_mapping(priv, f_index, rx_queue);
2878 bcmgenet_hfb_enable_filter(priv, f_index);
2879 bcmgenet_hfb_reg_writel(priv, 0x1, HFB_CTRL);
2880
2881 return 0;
2882 }
2883
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months