[linux-next:master 14301/14603] arch/powerpc/mm/book3s64/hash_utils.c:1119:21: error: use of undeclared identifier 'default_uamor'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: bc09acc9f224c0923794b69534c9bfa999c27b64
commit: 6553fb799f601497ca0703682e2aff131197dc5c [14301/14603] powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)
config: powerpc64-randconfig-r024-20200811 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 30c1633386e7cfb01c0a54b31ccf4c3a3873e71b)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
git checkout 6553fb799f601497ca0703682e2aff131197dc5c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/powerpc/mm/book3s64/hash_utils.c:1119:21: error: use of undeclared identifier 'default_uamor'
mtspr(SPRN_UAMOR, default_uamor);
^
arch/powerpc/mm/book3s64/hash_utils.c:1503:5: error: no previous prototype for function '__hash_page' [-Werror,-Wmissing-prototypes]
int __hash_page(unsigned long trap, unsigned long ea, unsigned long dsisr,
^
arch/powerpc/mm/book3s64/hash_utils.c:1503:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __hash_page(unsigned long trap, unsigned long ea, unsigned long dsisr,
^
static
arch/powerpc/mm/book3s64/hash_utils.c:1838:6: error: no previous prototype for function 'low_hash_fault' [-Werror,-Wmissing-prototypes]
void low_hash_fault(struct pt_regs *regs, unsigned long address, int rc)
^
arch/powerpc/mm/book3s64/hash_utils.c:1838:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void low_hash_fault(struct pt_regs *regs, unsigned long address, int rc)
^
static
arch/powerpc/mm/book3s64/hash_utils.c:1855:6: error: no previous prototype for function 'hpte_insert_repeating' [-Werror,-Wmissing-prototypes]
long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
^
arch/powerpc/mm/book3s64/hash_utils.c:1855:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
^
static
4 errors generated.
vim +/default_uamor +1119 arch/powerpc/mm/book3s64/hash_utils.c
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1098
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1099 #ifdef CONFIG_SMP
756d08d1ba169ed arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-04-29 1100 void hash__early_init_mmu_secondary(void)
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1101 {
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1102 /* Initialize hash table for that CPU */
b5dcc6096971b7c arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-04-29 1103 if (!firmware_has_feature(FW_FEATURE_LPAR)) {
cac4a185405d441 arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-11-17 1104
b5dcc6096971b7c arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-04-29 1105 if (!cpu_has_feature(CPU_FTR_ARCH_300))
799d6046d3fb557 arch/powerpc/mm/hash_utils_64.c Paul Mackerras 2005-11-10 1106 mtspr(SPRN_SDR1, _SDR1);
b5dcc6096971b7c arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-04-29 1107 else
5223134029a87db arch/powerpc/mm/book3s64/hash_utils.c Claudio Carvalho 2019-08-22 1108 set_ptcr_when_no_uv(__pa(partition_tb) |
5223134029a87db arch/powerpc/mm/book3s64/hash_utils.c Claudio Carvalho 2019-08-22 1109 (PATB_SIZE_SHIFT - 12));
b5dcc6096971b7c arch/powerpc/mm/hash_utils_64.c Aneesh Kumar K.V 2016-04-29 1110 }
376af5947c0e441 arch/powerpc/mm/hash_utils_64.c Michael Ellerman 2014-07-10 1111 /* Initialize SLB */
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1112 slb_initialize();
d4748276ae14ce9 arch/powerpc/mm/hash_utils_64.c Nicholas Piggin 2017-12-24 1113
d4748276ae14ce9 arch/powerpc/mm/hash_utils_64.c Nicholas Piggin 2017-12-24 1114 if (cpu_has_feature(CPU_FTR_ARCH_206)
d4748276ae14ce9 arch/powerpc/mm/hash_utils_64.c Nicholas Piggin 2017-12-24 1115 && cpu_has_feature(CPU_FTR_HVMODE))
d4748276ae14ce9 arch/powerpc/mm/hash_utils_64.c Nicholas Piggin 2017-12-24 1116 tlbiel_all();
e0d8e991be641ba arch/powerpc/mm/book3s64/hash_utils.c Aneesh Kumar K.V 2020-07-09 1117
6553fb799f60149 arch/powerpc/mm/book3s64/hash_utils.c Aneesh Kumar K.V 2020-08-10 1118 if (IS_ENABLED(CONFIG_PPC_MEM_KEYS) && mmu_has_feature(MMU_FTR_PKEY))
e0d8e991be641ba arch/powerpc/mm/book3s64/hash_utils.c Aneesh Kumar K.V 2020-07-09 @1119 mtspr(SPRN_UAMOR, default_uamor);
799d6046d3fb557 arch/powerpc/mm/hash_utils_64.c Paul Mackerras 2005-11-10 1120 }
757c74d298dc843 arch/powerpc/mm/hash_utils_64.c Benjamin Herrenschmidt 2009-03-19 1121 #endif /* CONFIG_SMP */
799d6046d3fb557 arch/powerpc/mm/hash_utils_64.c Paul Mackerras 2005-11-10 1122
:::::: The code at line 1119 was first introduced by commit
:::::: e0d8e991be641ba0034c67785bf86f6c097869d6 powerpc/book3s64/kuap: Move UAMOR setup to key init function
:::::: TO: Aneesh Kumar K.V <aneesh.kumar(a)linux.ibm.com>
:::::: CC: Michael Ellerman <mpe(a)ellerman.id.au>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/char/agp/i460-agp.c:254:19: sparse: expected void gatt
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dc06fe51d26efc100ac74121607c01a454867c91
commit: df41017eafd267c08acbfff99d34e4f96bbfbc92 ia64: remove support for machvecs
date: 12 months ago
config: ia64-randconfig-s031-20200813 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-168-g9554805c-dirty
git checkout df41017eafd267c08acbfff99d34e4f96bbfbc92
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/char/agp/i460-agp.c:254:19: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *static [assigned] [toplevel] gatt @@ got void [noderef] <asn:2> * @@
>> drivers/char/agp/i460-agp.c:254:19: sparse: expected void *static [assigned] [toplevel] gatt
drivers/char/agp/i460-agp.c:254:19: sparse: got void [noderef] <asn:2> *
drivers/char/agp/i460-agp.c:266:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:266:17: sparse: expected void volatile [noderef] <asn:2> *addr
>> drivers/char/agp/i460-agp.c:266:17: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:267:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:267:9: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:267:9: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:281:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:281:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:281:17: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:282:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:282:9: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:282:9: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:284:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got void *static [assigned] [toplevel] gatt @@
drivers/char/agp/i460-agp.c:284:21: sparse: expected void volatile [noderef] <asn:2> *addr
>> drivers/char/agp/i460-agp.c:284:21: sparse: got void *static [assigned] [toplevel] gatt
drivers/char/agp/i460-agp.c:318:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:318:22: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:318:22: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:318:22: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:318:22: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:318:22: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:319:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:319:25: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:319:25: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:330:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:330:25: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:330:25: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:332:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:332:9: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:332:9: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:347:17: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:347:17: sparse: expected void volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:347:17: sparse: got unsigned int [usertype] *
drivers/char/agp/i460-agp.c:348:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] <asn:2> *addr @@ got unsigned int [usertype] * @@
drivers/char/agp/i460-agp.c:348:9: sparse: expected void const volatile [noderef] <asn:2> *addr
drivers/char/agp/i460-agp.c:348:9: sparse: got unsigned int [usertype] *
>> drivers/char/agp/i460-agp.c:556:32: sparse: sparse: symbol 'intel_i460_driver' was not declared. Should it be static?
drivers/char/agp/i460-agp.c: note: in included file (through arch/ia64/include/asm/io.h, arch/ia64/include/asm/smp.h, include/linux/smp.h, ...):
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
vim +254 drivers/char/agp/i460-agp.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 241
^1da177e4c3f41 Linus Torvalds 2005-04-16 242 static int i460_create_gatt_table (struct agp_bridge_data *bridge)
^1da177e4c3f41 Linus Torvalds 2005-04-16 243 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 244 int page_order, num_entries, i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 245 void *temp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 246
^1da177e4c3f41 Linus Torvalds 2005-04-16 247 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 248 * Load up the fixed address of the GART SRAMS which hold our GATT table.
^1da177e4c3f41 Linus Torvalds 2005-04-16 249 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 250 temp = agp_bridge->current_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 251 page_order = A_SIZE_8(temp)->page_order;
^1da177e4c3f41 Linus Torvalds 2005-04-16 252 num_entries = A_SIZE_8(temp)->num_entries;
^1da177e4c3f41 Linus Torvalds 2005-04-16 253
^1da177e4c3f41 Linus Torvalds 2005-04-16 @254 i460.gatt = ioremap(INTEL_I460_ATTBASE, PAGE_SIZE << page_order);
5bdbc7dc2c07d5 Scott Thompson 2007-08-25 255 if (!i460.gatt) {
5bdbc7dc2c07d5 Scott Thompson 2007-08-25 256 printk(KERN_ERR PFX "ioremap failed\n");
5bdbc7dc2c07d5 Scott Thompson 2007-08-25 257 return -ENOMEM;
5bdbc7dc2c07d5 Scott Thompson 2007-08-25 258 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 259
^1da177e4c3f41 Linus Torvalds 2005-04-16 260 /* These are no good, the should be removed from the agp_bridge strucure... */
^1da177e4c3f41 Linus Torvalds 2005-04-16 261 agp_bridge->gatt_table_real = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 262 agp_bridge->gatt_table = NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 263 agp_bridge->gatt_bus_addr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 264
^1da177e4c3f41 Linus Torvalds 2005-04-16 265 for (i = 0; i < num_entries; ++i)
^1da177e4c3f41 Linus Torvalds 2005-04-16 @266 WR_GATT(i, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 267 WR_FLUSH_GATT(i - 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 268 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 269 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 270
^1da177e4c3f41 Linus Torvalds 2005-04-16 271 static int i460_free_gatt_table (struct agp_bridge_data *bridge)
^1da177e4c3f41 Linus Torvalds 2005-04-16 272 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 273 int num_entries, i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 274 void *temp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 275
^1da177e4c3f41 Linus Torvalds 2005-04-16 276 temp = agp_bridge->current_size;
^1da177e4c3f41 Linus Torvalds 2005-04-16 277
^1da177e4c3f41 Linus Torvalds 2005-04-16 278 num_entries = A_SIZE_8(temp)->num_entries;
^1da177e4c3f41 Linus Torvalds 2005-04-16 279
^1da177e4c3f41 Linus Torvalds 2005-04-16 280 for (i = 0; i < num_entries; ++i)
^1da177e4c3f41 Linus Torvalds 2005-04-16 281 WR_GATT(i, 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 282 WR_FLUSH_GATT(num_entries - 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 283
^1da177e4c3f41 Linus Torvalds 2005-04-16 @284 iounmap(i460.gatt);
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 286 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 287
:::::: The code at line 254 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/md/dm-ebs-target.c:264:4: warning: Variable 'r' is reassigned a value before the old one has been used.
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dc06fe51d26efc100ac74121607c01a454867c91
commit: d3c7b35c20d60650bac8b55c17b194adda03a979 dm: add emulated block size target
date: 3 months ago
compiler: sparc-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> drivers/md/dm-ebs-target.c:264:4: warning: Variable 'r' is reassigned a value before the old one has been used. [redundantAssignment]
r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &ec->dev);
^
drivers/md/dm-ebs-target.c:237:4: note: Variable 'r' is reassigned a value before the old one has been used.
r = -EINVAL;
^
drivers/md/dm-ebs-target.c:264:4: note: Variable 'r' is reassigned a value before the old one has been used.
r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &ec->dev);
^
vim +/r +264 drivers/md/dm-ebs-target.c
208
209 /*
210 * Construct an emulated block size mapping: <dev_path> <offset> <ebs> [<ubs>]
211 *
212 * <dev_path>: path of the underlying device
213 * <offset>: offset in 512 bytes sectors into <dev_path>
214 * <ebs>: emulated block size in units of 512 bytes exposed to the upper layer
215 * [<ubs>]: underlying block size in units of 512 bytes imposed on the lower layer;
216 * optional, if not supplied, retrieve logical block size from underlying device
217 */
218 static int ebs_ctr(struct dm_target *ti, unsigned int argc, char **argv)
219 {
220 int r;
221 unsigned short tmp1;
222 unsigned long long tmp;
223 char dummy;
224 struct ebs_c *ec;
225
226 if (argc < 3 || argc > 4) {
227 ti->error = "Invalid argument count";
228 return -EINVAL;
229 }
230
231 ec = ti->private = kzalloc(sizeof(*ec), GFP_KERNEL);
232 if (!ec) {
233 ti->error = "Cannot allocate ebs context";
234 return -ENOMEM;
235 }
236
237 r = -EINVAL;
238 if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1 ||
239 tmp != (sector_t)tmp ||
240 (sector_t)tmp >= ti->len) {
241 ti->error = "Invalid device offset sector";
242 goto bad;
243 }
244 ec->start = tmp;
245
246 if (sscanf(argv[2], "%hu%c", &tmp1, &dummy) != 1 ||
247 !__ebs_check_bs(tmp1) ||
248 to_bytes(tmp1) > PAGE_SIZE) {
249 ti->error = "Invalid emulated block size";
250 goto bad;
251 }
252 ec->e_bs = tmp1;
253
254 if (argc > 3) {
255 if (sscanf(argv[3], "%hu%c", &tmp1, &dummy) != 1 || !__ebs_check_bs(tmp1)) {
256 ti->error = "Invalid underlying block size";
257 goto bad;
258 }
259 ec->u_bs = tmp1;
260 ec->u_bs_set = true;
261 } else
262 ec->u_bs_set = false;
263
> 264 r = dm_get_device(ti, argv[0], dm_table_get_mode(ti->table), &ec->dev);
265 if (r) {
266 ti->error = "Device lookup failed";
267 ec->dev = NULL;
268 goto bad;
269 }
270
271 r = -EINVAL;
272 if (!ec->u_bs_set) {
273 ec->u_bs = to_sector(bdev_logical_block_size(ec->dev->bdev));
274 if (!__ebs_check_bs(ec->u_bs)) {
275 ti->error = "Invalid retrieved underlying block size";
276 goto bad;
277 }
278 }
279
280 if (!ec->u_bs_set && ec->e_bs == ec->u_bs)
281 DMINFO("Emulation superfluous: emulated equal to underlying block size");
282
283 if (__block_mod(ec->start, ec->u_bs)) {
284 ti->error = "Device offset must be multiple of underlying block size";
285 goto bad;
286 }
287
288 ec->bufio = dm_bufio_client_create(ec->dev->bdev, to_bytes(ec->u_bs), 1, 0, NULL, NULL);
289 if (IS_ERR(ec->bufio)) {
290 ti->error = "Cannot create dm bufio client";
291 r = PTR_ERR(ec->bufio);
292 ec->bufio = NULL;
293 goto bad;
294 }
295
296 ec->wq = alloc_ordered_workqueue("dm-" DM_MSG_PREFIX, WQ_MEM_RECLAIM);
297 if (!ec->wq) {
298 ti->error = "Cannot create dm-" DM_MSG_PREFIX " workqueue";
299 r = -ENOMEM;
300 goto bad;
301 }
302
303 ec->block_shift = __ffs(ec->u_bs);
304 INIT_WORK(&ec->ws, &__ebs_process_bios);
305 bio_list_init(&ec->bios_in);
306 spin_lock_init(&ec->lock);
307
308 ti->num_flush_bios = 1;
309 ti->num_discard_bios = 1;
310 ti->num_secure_erase_bios = 0;
311 ti->num_write_same_bios = 0;
312 ti->num_write_zeroes_bios = 0;
313 return 0;
314 bad:
315 ebs_dtr(ti);
316 return r;
317 }
318
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:5638 bnx2x_link_settings_status() warn: signedness bug returning '(-22)'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: 2c855d73f2f6107f5b8ebc45f8b934bf7f4419e0 bnx2x: Remove read_status_t function casts
date: 9 months ago
config: ia64-randconfig-m031-20200811 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:5638 bnx2x_link_settings_status() warn: signedness bug returning '(-22)'
Old smatch warnings:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:7184 bnx2x_8073_8727_external_rom_boot() error: uninitialized symbol 'fw_ver1'.
vim +5638 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
239d686d494f10e drivers/net/bnx2x_link.c Eilon Greenstein 2009-08-12 5613
2c855d73f2f6107 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Kees Cook 2019-11-14 5614 static u8 bnx2x_link_settings_status(struct bnx2x_phy *phy,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5615 struct link_params *params,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5616 struct link_vars *vars)
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5617 {
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5618 struct bnx2x *bp = params->bp;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5619
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5620 u16 gp_status, duplex = DUPLEX_HALF, link_up = 0, speed_mask;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5621 int rc = 0;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5622
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5623 /* Read gp_status */
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5624 CL22_RD_OVER_CL45(bp, phy,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5625 MDIO_REG_BANK_GP_STATUS,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5626 MDIO_GP_STATUS_TOP_AN_STATUS1,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5627 &gp_status);
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5628 if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_DUPLEX_STATUS)
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5629 duplex = DUPLEX_FULL;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5630 if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS)
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5631 link_up = 1;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5632 speed_mask = gp_status & GP_STATUS_SPEED_MASK;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5633 DP(NETIF_MSG_LINK, "gp_status 0x%x, is_link_up %d, speed_mask 0x%x\n",
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5634 gp_status, link_up, speed_mask);
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5635 rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, speed_mask,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5636 duplex);
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5637 if (rc == -EINVAL)
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 @5638 return rc;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5639
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5640 if (gp_status & MDIO_GP_STATUS_TOP_AN_STATUS1_LINK_STATUS) {
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5641 if (SINGLE_MEDIA_DIRECT(params)) {
430d172a635c3dd drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Yaniv Rosner 2012-09-11 5642 vars->duplex = duplex;
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5643 bnx2x_flow_ctrl_resolve(phy, params, vars, gp_status);
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5644 if (phy->req_line_speed == SPEED_AUTO_NEG)
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5645 bnx2x_xgxs_an_resolve(phy, params, vars,
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5646 gp_status);
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5647 }
d231023eb17134e drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Yuval Mintz 2012-06-20 5648 } else { /* Link_down */
c18aa15d08a2d1a drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2010-09-07 5649 if ((phy->req_line_speed == SPEED_AUTO_NEG) &&
c18aa15d08a2d1a drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2010-09-07 5650 SINGLE_MEDIA_DIRECT(params)) {
239d686d494f10e drivers/net/bnx2x_link.c Eilon Greenstein 2009-08-12 5651 /* Check signal is detected */
c18aa15d08a2d1a drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2010-09-07 5652 bnx2x_check_fallback_to_cl37(phy, params);
239d686d494f10e drivers/net/bnx2x_link.c Eilon Greenstein 2009-08-12 5653 }
ea4e040abc72f2d drivers/net/bnx2x_link.c Yaniv Rosner 2008-06-23 5654 }
ea4e040abc72f2d drivers/net/bnx2x_link.c Yaniv Rosner 2008-06-23 5655
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5656 /* Read LP advertised speeds*/
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5657 if (SINGLE_MEDIA_DIRECT(params) &&
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5658 (vars->link_status & LINK_STATUS_AUTO_NEGOTIATE_COMPLETE)) {
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5659 u16 val;
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5660
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5661 CL22_RD_OVER_CL45(bp, phy, MDIO_REG_BANK_CL73_IEEEB1,
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5662 MDIO_CL73_IEEEB1_AN_LP_ADV2, &val);
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5663
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5664 if (val & MDIO_CL73_IEEEB1_AN_ADV2_ADVR_1000M_KX)
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5665 vars->link_status |=
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5666 LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE;
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5667 if (val & (MDIO_CL73_IEEEB1_AN_ADV2_ADVR_10G_KX4 |
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5668 MDIO_CL73_IEEEB1_AN_ADV2_ADVR_10G_KR))
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5669 vars->link_status |=
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5670 LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE;
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5671
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5672 CL22_RD_OVER_CL45(bp, phy, MDIO_REG_BANK_OVER_1G,
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5673 MDIO_OVER_1G_LP_UP1, &val);
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5674
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5675 if (val & MDIO_OVER_1G_UP1_2_5G)
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5676 vars->link_status |=
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5677 LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE;
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5678 if (val & (MDIO_OVER_1G_UP1_10G | MDIO_OVER_1G_UP1_10GH))
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5679 vars->link_status |=
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5680 LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE;
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5681 }
9e7e8399c5d3c4d drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c Mintz Yuval 2012-02-15 5682
a22f078867ef362 drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2010-09-07 5683 DP(NETIF_MSG_LINK, "duplex %x flow_ctrl 0x%x link_status 0x%x\n",
a22f078867ef362 drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2010-09-07 5684 vars->duplex, vars->flow_ctrl, vars->link_status);
ea4e040abc72f2d drivers/net/bnx2x_link.c Yaniv Rosner 2008-06-23 5685 return rc;
ea4e040abc72f2d drivers/net/bnx2x_link.c Yaniv Rosner 2008-06-23 5686 }
3c9ada227c56c6f drivers/net/bnx2x/bnx2x_link.c Yaniv Rosner 2011-06-14 5687
:::::: The code at line 5638 was first introduced by commit
:::::: 3c9ada227c56c6f41e24b01d183b00b007c7ac93 bnx2x: Add Warpcore support for 578xx
:::::: TO: Yaniv Rosner <yanivr(a)broadcom.com>
:::::: CC: David S. Miller <davem(a)conan.davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[oracle-dtrace-linux-kernel:v2/5.8.1 3/13] include/uapi/asm-generic/unistd.h:862:24: error: 'sys_waitfd' undeclared here (not in a function); did you mean
by kernel test robot
tree: https://github.com/oracle/dtrace-linux-kernel v2/5.8.1
head: fafd5b152580df5ed8e4d07bf9e81c5c187f418e
commit: 2b43b09818b3931af79145096f2cc5b16d3fe9ed [3/13] waitfd: new syscall implementing waitpid() over fds
config: arc-randconfig-r016-20200812 (attached as .config)
compiler: arc-elf-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 2b43b09818b3931af79145096f2cc5b16d3fe9ed
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
| ^
include/uapi/asm-generic/unistd.h:840:1: note: in expansion of macro '__SYSCALL'
840 | __SYSCALL(__NR_fsopen, sys_fsopen)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:842:1: note: in expansion of macro '__SYSCALL'
842 | __SYSCALL(__NR_fsconfig, sys_fsconfig)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[431]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:842:1: note: in expansion of macro '__SYSCALL'
842 | __SYSCALL(__NR_fsconfig, sys_fsconfig)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:844:1: note: in expansion of macro '__SYSCALL'
844 | __SYSCALL(__NR_fsmount, sys_fsmount)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[432]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:844:1: note: in expansion of macro '__SYSCALL'
844 | __SYSCALL(__NR_fsmount, sys_fsmount)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:846:1: note: in expansion of macro '__SYSCALL'
846 | __SYSCALL(__NR_fspick, sys_fspick)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[433]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:846:1: note: in expansion of macro '__SYSCALL'
846 | __SYSCALL(__NR_fspick, sys_fspick)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:848:1: note: in expansion of macro '__SYSCALL'
848 | __SYSCALL(__NR_pidfd_open, sys_pidfd_open)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[434]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:848:1: note: in expansion of macro '__SYSCALL'
848 | __SYSCALL(__NR_pidfd_open, sys_pidfd_open)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:851:1: note: in expansion of macro '__SYSCALL'
851 | __SYSCALL(__NR_clone3, sys_clone3)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[435]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:851:1: note: in expansion of macro '__SYSCALL'
851 | __SYSCALL(__NR_clone3, sys_clone3)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:855:1: note: in expansion of macro '__SYSCALL'
855 | __SYSCALL(__NR_openat2, sys_openat2)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[437]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:855:1: note: in expansion of macro '__SYSCALL'
855 | __SYSCALL(__NR_openat2, sys_openat2)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:857:1: note: in expansion of macro '__SYSCALL'
857 | __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[438]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:857:1: note: in expansion of macro '__SYSCALL'
857 | __SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:859:1: note: in expansion of macro '__SYSCALL'
859 | __SYSCALL(__NR_faccessat2, sys_faccessat2)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[439]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
include/uapi/asm-generic/unistd.h:859:1: note: in expansion of macro '__SYSCALL'
859 | __SYSCALL(__NR_faccessat2, sys_faccessat2)
| ^~~~~~~~~
>> include/uapi/asm-generic/unistd.h:862:24: error: 'sys_waitfd' undeclared here (not in a function); did you mean 'sys_waitid'?
862 | __SYSCALL(__NR_waitfd, sys_waitfd)
| ^~~~~~~~~~
arch/arc/kernel/sys.c:13:37: note: in definition of macro '__SYSCALL'
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:44:1: note: in expansion of macro '__SYSCALL'
44 | __SYSCALL(__NR_cacheflush, sys_cacheflush)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[244]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:44:1: note: in expansion of macro '__SYSCALL'
44 | __SYSCALL(__NR_cacheflush, sys_cacheflush)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:45:1: note: in expansion of macro '__SYSCALL'
45 | __SYSCALL(__NR_arc_settls, sys_arc_settls)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[245]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:45:1: note: in expansion of macro '__SYSCALL'
45 | __SYSCALL(__NR_arc_settls, sys_arc_settls)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:46:1: note: in expansion of macro '__SYSCALL'
46 | __SYSCALL(__NR_arc_gettls, sys_arc_gettls)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[246]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:46:1: note: in expansion of macro '__SYSCALL'
46 | __SYSCALL(__NR_arc_gettls, sys_arc_gettls)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:47:1: note: in expansion of macro '__SYSCALL'
47 | __SYSCALL(__NR_arc_usr_cmpxchg, sys_arc_usr_cmpxchg)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[248]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:47:1: note: in expansion of macro '__SYSCALL'
47 | __SYSCALL(__NR_arc_usr_cmpxchg, sys_arc_usr_cmpxchg)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: warning: initialized field overwritten [-Woverride-init]
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:48:1: note: in expansion of macro '__SYSCALL'
48 | __SYSCALL(__NR_sysfs, sys_sysfs)
| ^~~~~~~~~
arch/arc/kernel/sys.c:13:36: note: (near initialization for 'sys_call_table[247]')
13 | #define __SYSCALL(nr, call) [nr] = (call),
| ^
arch/arc/include/uapi/asm/unistd.h:48:1: note: in expansion of macro '__SYSCALL'
48 | __SYSCALL(__NR_sysfs, sys_sysfs)
| ^~~~~~~~~
In file included from include/linux/perf_event.h:25,
from include/linux/trace_events.h:10,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:85,
from arch/arc/kernel/sys.c:3:
arch/arc/include/asm/perf_event.h:126:23: warning: 'arc_pmu_cache_map' defined but not used [-Wunused-const-variable=]
126 | static const unsigned arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:91:27: warning: 'arc_pmu_ev_hw_map' defined but not used [-Wunused-const-variable=]
91 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~
vim +862 include/uapi/asm-generic/unistd.h
860
861 #define __NR_waitfd 473
> 862 __SYSCALL(__NR_waitfd, sys_waitfd)
863
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dc06fe51d26efc100ac74121607c01a454867c91
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 8 weeks ago
config: i386-randconfig-s001-20200813 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-168-g9554805c-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: expected void *reg
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:2135:41: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned short [usertype] uid_hi @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: expected unsigned short [usertype] uid_hi
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:33: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] uid_lo @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: expected unsigned int [usertype] uid_lo
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:45: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: sparse: incorrect type in argument 4 (different base types) @@ expected unsigned short [usertype] seqid @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: expected unsigned short [usertype] seqid
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:157:56: sparse: got restricted __be16 [usertype]
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem * @@ got void *reg @@
>> drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: expected void [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:306:26: sparse: got void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:336:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:343:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:356:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:397:33: sparse: got unsigned int [noderef] __iomem *
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *reg @@ got unsigned int [noderef] __iomem * @@
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: expected void *reg
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c:466:41: sparse: got unsigned int [noderef] __iomem *
vim +2135 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2084
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2085 /**
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2086 * pch_gbe_set_multi - Multicast and Promiscuous mode set
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2087 * @netdev: Network interface device structure
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2088 */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2089 static void pch_gbe_set_multi(struct net_device *netdev)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2090 {
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2091 struct pch_gbe_adapter *adapter = netdev_priv(netdev);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2092 struct pch_gbe_hw *hw = &adapter->hw;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2093 struct netdev_hw_addr *ha;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2094 u32 rctl, adrmask;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2095 int mc_count, i;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2096
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2097 netdev_dbg(netdev, "netdev->flags : 0x%08x\n", netdev->flags);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2098
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2099 /* By default enable address & multicast filtering */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2100 rctl = ioread32(&hw->reg->RX_MODE);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2101 rctl |= PCH_GBE_ADD_FIL_EN | PCH_GBE_MLT_FIL_EN;
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2102
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2103 /* Promiscuous mode disables all hardware address filtering */
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2104 if (netdev->flags & IFF_PROMISC)
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2105 rctl &= ~(PCH_GBE_ADD_FIL_EN | PCH_GBE_MLT_FIL_EN);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2106
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2107 /* If we want to monitor more multicast addresses than the hardware can
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2108 * support then disable hardware multicast filtering.
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2109 */
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2110 mc_count = netdev_mc_count(netdev);
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2111 if ((netdev->flags & IFF_ALLMULTI) || mc_count >= PCH_GBE_MAR_ENTRIES)
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2112 rctl &= ~PCH_GBE_MLT_FIL_EN;
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2113
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2114 iowrite32(rctl, &hw->reg->RX_MODE);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2115
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2116 /* If we're not using multicast filtering then there's no point
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2117 * configuring the unused MAC address registers.
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2118 */
418e7dab0f83fc drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2119 if (!(rctl & PCH_GBE_MLT_FIL_EN))
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2120 return;
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2121
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2122 /* Load the first set of multicast addresses into MAC address registers
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2123 * for use by hardware filtering.
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2124 */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2125 i = 1;
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2126 netdev_for_each_mc_addr(ha, netdev)
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2127 pch_gbe_mac_mar_set(hw, ha->addr, i++);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2128
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2129 /* If there are spare MAC registers, mask & clear them */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2130 for (; i < PCH_GBE_MAR_ENTRIES; i++) {
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2131 /* Clear MAC address mask */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2132 adrmask = ioread32(&hw->reg->ADDR_MASK);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2133 iowrite32(adrmask | BIT(i), &hw->reg->ADDR_MASK);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2134 /* wait busy */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 @2135 pch_gbe_wait_clr_bit(&hw->reg->ADDR_MASK, PCH_GBE_BUSY);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2136 /* Clear MAC address */
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2137 iowrite32(0, &hw->reg->mac_adr[i].high);
6ab91e47694e03 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Paul Burton 2018-06-22 2138 iowrite32(0, &hw->reg->mac_adr[i].low);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2139 }
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2140
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2141 netdev_dbg(netdev,
453ca931f51516 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c Andy Shevchenko 2013-06-28 2142 "RX_MODE reg(check bit31,30 ADD,MLT) : 0x%08x netdev->mc_count : 0x%08x\n",
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2143 ioread32(&hw->reg->RX_MODE), mc_count);
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2144 }
77555ee7228234 drivers/net/pch_gbe/pch_gbe_main.c Masayuki Ohtake 2010-09-21 2145
:::::: The code at line 2135 was first introduced by commit
:::::: 6ab91e47694e03775bbe874fa8f15f84db404c00 net: pch_gbe: Inline pch_gbe_mac_mc_addr_list_update
:::::: TO: Paul Burton <paul.burton(a)mips.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, 1 month
drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7c2a69f610e64c8dec6a06a66e721f4ce1dd783a
commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script
date: 8 days ago
config: x86_64-randconfig-c004-20200812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/acpi/dock.c:563:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:544:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:495:8-16: WARNING: use scnprintf or sprintf
drivers/acpi/dock.c:506:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-arvo.c:149:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:95:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-arvo.c:45:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-isku.c:66:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-kone.c:406:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:397:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:438:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:550:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:448:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kone.c:429:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-koneplus.c:247:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-koneplus.c:314:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-kovaplus.c:330:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:277:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:339:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:349:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-kovaplus.c:370:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-roccat-pyra.c:289:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:306:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-roccat-pyra.c:327:8-16: WARNING: use scnprintf or sprintf
--
>> drivers/hid/hid-sony.c:611:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:648:8-16: WARNING: use scnprintf or sprintf
drivers/hid/hid-sony.c:660:8-16: WARNING: use scnprintf or sprintf
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[krzk-github:for-next/dts-imx8-variscite-v2 14/22] drivers/extcon/extcon-ptn5150.c:167 ptn5150_irq_work() error: double unlocked 'info->mutex' (orig line 151)
by kernel test robot
tree: https://github.com/krzk/linux for-next/dts-imx8-variscite-v2
head: 30aacaeb50ba26cd71f5812ca47cb69eadab4a7d
commit: a6e6203e71c9574eda9b1dee279a3760018db661 [14/22] extcon: ptn5150: Check current USB mode when probing
config: i386-randconfig-m031-20200811 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/extcon/extcon-ptn5150.c:167 ptn5150_irq_work() error: double unlocked 'info->mutex' (orig line 151)
drivers/extcon/extcon-ptn5150.c:309 ptn5150_i2c_probe() error: double unlocked 'info->mutex' (orig line 308)
Old smatch warnings:
drivers/extcon/extcon-ptn5150.c:171 ptn5150_irq_work() error: double unlocked 'info->mutex' (orig line 151)
vim +167 drivers/extcon/extcon-ptn5150.c
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 125
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 126 static void ptn5150_irq_work(struct work_struct *work)
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 127 {
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 128 struct ptn5150_info *info = container_of(work,
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 129 struct ptn5150_info, irq_work);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 130 int ret = 0;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 131 unsigned int int_status;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 132
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 133 if (!info->edev)
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 134 return;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 135
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 136 mutex_lock(&info->mutex);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 137
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 138 /* Clear interrupt. Read would clear the register */
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 139 ret = regmap_read(info->regmap, PTN5150_REG_INT_STATUS, &int_status);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 140 if (ret) {
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 141 dev_err(info->dev, "failed to read INT STATUS %d\n", ret);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 142 mutex_unlock(&info->mutex);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 143 return;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 144 }
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 145
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 146 if (int_status) {
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 147 unsigned int cable_attach;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 148
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 149 cable_attach = int_status & PTN5150_REG_INT_CABLE_ATTACH_MASK;
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 150 if (cable_attach) {
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 @151 ptn5150_check_state(info);
4ed754de2d66084 Vijai Kumar K 2019-01-23 152 } else {
4ed754de2d66084 Vijai Kumar K 2019-01-23 153 extcon_set_state_sync(info->edev,
4ed754de2d66084 Vijai Kumar K 2019-01-23 154 EXTCON_USB_HOST, false);
4ed754de2d66084 Vijai Kumar K 2019-01-23 155 extcon_set_state_sync(info->edev,
4ed754de2d66084 Vijai Kumar K 2019-01-23 156 EXTCON_USB, false);
9327b22421e2cae Krzysztof Kozlowski 2020-08-12 157 gpiod_set_value_cansleep(info->vbus_gpiod, 0);
4ed754de2d66084 Vijai Kumar K 2019-01-23 158 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 159 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 160
4ed754de2d66084 Vijai Kumar K 2019-01-23 161 /* Clear interrupt. Read would clear the register */
4ed754de2d66084 Vijai Kumar K 2019-01-23 162 ret = regmap_read(info->regmap, PTN5150_REG_INT_REG_STATUS,
4ed754de2d66084 Vijai Kumar K 2019-01-23 163 &int_status);
4ed754de2d66084 Vijai Kumar K 2019-01-23 164 if (ret) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 165 dev_err(info->dev,
4ed754de2d66084 Vijai Kumar K 2019-01-23 166 "failed to read INT REG STATUS %d\n", ret);
4ed754de2d66084 Vijai Kumar K 2019-01-23 @167 mutex_unlock(&info->mutex);
4ed754de2d66084 Vijai Kumar K 2019-01-23 168 return;
4ed754de2d66084 Vijai Kumar K 2019-01-23 169 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 170
4ed754de2d66084 Vijai Kumar K 2019-01-23 171 mutex_unlock(&info->mutex);
4ed754de2d66084 Vijai Kumar K 2019-01-23 172 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 173
4ed754de2d66084 Vijai Kumar K 2019-01-23 174
4ed754de2d66084 Vijai Kumar K 2019-01-23 175 static irqreturn_t ptn5150_irq_handler(int irq, void *data)
4ed754de2d66084 Vijai Kumar K 2019-01-23 176 {
4ed754de2d66084 Vijai Kumar K 2019-01-23 177 struct ptn5150_info *info = data;
4ed754de2d66084 Vijai Kumar K 2019-01-23 178
4ed754de2d66084 Vijai Kumar K 2019-01-23 179 schedule_work(&info->irq_work);
4ed754de2d66084 Vijai Kumar K 2019-01-23 180
4ed754de2d66084 Vijai Kumar K 2019-01-23 181 return IRQ_HANDLED;
4ed754de2d66084 Vijai Kumar K 2019-01-23 182 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 183
4ed754de2d66084 Vijai Kumar K 2019-01-23 184 static int ptn5150_init_dev_type(struct ptn5150_info *info)
4ed754de2d66084 Vijai Kumar K 2019-01-23 185 {
4ed754de2d66084 Vijai Kumar K 2019-01-23 186 unsigned int reg_data, vendor_id, version_id;
4ed754de2d66084 Vijai Kumar K 2019-01-23 187 int ret;
4ed754de2d66084 Vijai Kumar K 2019-01-23 188
4ed754de2d66084 Vijai Kumar K 2019-01-23 189 ret = regmap_read(info->regmap, PTN5150_REG_DEVICE_ID, ®_data);
4ed754de2d66084 Vijai Kumar K 2019-01-23 190 if (ret) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 191 dev_err(info->dev, "failed to read DEVICE_ID %d\n", ret);
4ed754de2d66084 Vijai Kumar K 2019-01-23 192 return -EINVAL;
4ed754de2d66084 Vijai Kumar K 2019-01-23 193 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 194
4ed754de2d66084 Vijai Kumar K 2019-01-23 195 vendor_id = ((reg_data & PTN5150_REG_DEVICE_ID_VENDOR_MASK) >>
4ed754de2d66084 Vijai Kumar K 2019-01-23 196 PTN5150_REG_DEVICE_ID_VENDOR_SHIFT);
4ed754de2d66084 Vijai Kumar K 2019-01-23 197 version_id = ((reg_data & PTN5150_REG_DEVICE_ID_VERSION_MASK) >>
4ed754de2d66084 Vijai Kumar K 2019-01-23 198 PTN5150_REG_DEVICE_ID_VERSION_SHIFT);
4ed754de2d66084 Vijai Kumar K 2019-01-23 199
81189b6db9a07ce Krzysztof Kozlowski 2020-08-12 200 dev_dbg(info->dev, "Device type: version: 0x%x, vendor: 0x%x\n",
4ed754de2d66084 Vijai Kumar K 2019-01-23 201 version_id, vendor_id);
4ed754de2d66084 Vijai Kumar K 2019-01-23 202
4ed754de2d66084 Vijai Kumar K 2019-01-23 203 /* Clear any existing interrupts */
4ed754de2d66084 Vijai Kumar K 2019-01-23 204 ret = regmap_read(info->regmap, PTN5150_REG_INT_STATUS, ®_data);
4ed754de2d66084 Vijai Kumar K 2019-01-23 205 if (ret) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 206 dev_err(info->dev,
4ed754de2d66084 Vijai Kumar K 2019-01-23 207 "failed to read PTN5150_REG_INT_STATUS %d\n",
4ed754de2d66084 Vijai Kumar K 2019-01-23 208 ret);
4ed754de2d66084 Vijai Kumar K 2019-01-23 209 return -EINVAL;
4ed754de2d66084 Vijai Kumar K 2019-01-23 210 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 211
4ed754de2d66084 Vijai Kumar K 2019-01-23 212 ret = regmap_read(info->regmap, PTN5150_REG_INT_REG_STATUS, ®_data);
4ed754de2d66084 Vijai Kumar K 2019-01-23 213 if (ret) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 214 dev_err(info->dev,
4ed754de2d66084 Vijai Kumar K 2019-01-23 215 "failed to read PTN5150_REG_INT_REG_STATUS %d\n", ret);
4ed754de2d66084 Vijai Kumar K 2019-01-23 216 return -EINVAL;
4ed754de2d66084 Vijai Kumar K 2019-01-23 217 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 218
4ed754de2d66084 Vijai Kumar K 2019-01-23 219 return 0;
4ed754de2d66084 Vijai Kumar K 2019-01-23 220 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 221
4ed754de2d66084 Vijai Kumar K 2019-01-23 222 static int ptn5150_i2c_probe(struct i2c_client *i2c,
4ed754de2d66084 Vijai Kumar K 2019-01-23 223 const struct i2c_device_id *id)
4ed754de2d66084 Vijai Kumar K 2019-01-23 224 {
4ed754de2d66084 Vijai Kumar K 2019-01-23 225 struct device *dev = &i2c->dev;
4ed754de2d66084 Vijai Kumar K 2019-01-23 226 struct device_node *np = i2c->dev.of_node;
4ed754de2d66084 Vijai Kumar K 2019-01-23 227 struct ptn5150_info *info;
4ed754de2d66084 Vijai Kumar K 2019-01-23 228 int ret;
4ed754de2d66084 Vijai Kumar K 2019-01-23 229
4ed754de2d66084 Vijai Kumar K 2019-01-23 230 if (!np)
4ed754de2d66084 Vijai Kumar K 2019-01-23 231 return -EINVAL;
4ed754de2d66084 Vijai Kumar K 2019-01-23 232
4ed754de2d66084 Vijai Kumar K 2019-01-23 233 info = devm_kzalloc(&i2c->dev, sizeof(*info), GFP_KERNEL);
4ed754de2d66084 Vijai Kumar K 2019-01-23 234 if (!info)
4ed754de2d66084 Vijai Kumar K 2019-01-23 235 return -ENOMEM;
4ed754de2d66084 Vijai Kumar K 2019-01-23 236 i2c_set_clientdata(i2c, info);
4ed754de2d66084 Vijai Kumar K 2019-01-23 237
4ed754de2d66084 Vijai Kumar K 2019-01-23 238 info->dev = &i2c->dev;
4ed754de2d66084 Vijai Kumar K 2019-01-23 239 info->i2c = i2c;
c0d06795a233222 Krzysztof Kozlowski 2020-08-11 240 info->vbus_gpiod = devm_gpiod_get(&i2c->dev, "vbus", GPIOD_OUT_LOW);
3dfed89512d3b65 Wei Yongjun 2019-01-25 241 if (IS_ERR(info->vbus_gpiod)) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 242 dev_err(dev, "failed to get VBUS GPIO\n");
3dfed89512d3b65 Wei Yongjun 2019-01-25 243 return PTR_ERR(info->vbus_gpiod);
4ed754de2d66084 Vijai Kumar K 2019-01-23 244 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 245
4ed754de2d66084 Vijai Kumar K 2019-01-23 246 mutex_init(&info->mutex);
4ed754de2d66084 Vijai Kumar K 2019-01-23 247
4ed754de2d66084 Vijai Kumar K 2019-01-23 248 INIT_WORK(&info->irq_work, ptn5150_irq_work);
4ed754de2d66084 Vijai Kumar K 2019-01-23 249
4ed754de2d66084 Vijai Kumar K 2019-01-23 250 info->regmap = devm_regmap_init_i2c(i2c, &ptn5150_regmap_config);
4ed754de2d66084 Vijai Kumar K 2019-01-23 251 if (IS_ERR(info->regmap)) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 252 ret = PTR_ERR(info->regmap);
4ed754de2d66084 Vijai Kumar K 2019-01-23 253 dev_err(info->dev, "failed to allocate register map: %d\n",
4ed754de2d66084 Vijai Kumar K 2019-01-23 254 ret);
4ed754de2d66084 Vijai Kumar K 2019-01-23 255 return ret;
4ed754de2d66084 Vijai Kumar K 2019-01-23 256 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 257
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 258 if (i2c->irq > 0) {
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 259 info->irq = i2c->irq;
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 260 } else {
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 261 info->int_gpiod = devm_gpiod_get(&i2c->dev, "int", GPIOD_IN);
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 262 if (IS_ERR(info->int_gpiod)) {
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 263 dev_err(dev, "failed to get INT GPIO\n");
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 264 return PTR_ERR(info->int_gpiod);
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 265 }
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 266
4ed754de2d66084 Vijai Kumar K 2019-01-23 267 info->irq = gpiod_to_irq(info->int_gpiod);
4ed754de2d66084 Vijai Kumar K 2019-01-23 268 if (info->irq < 0) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 269 dev_err(dev, "failed to get INTB IRQ\n");
4ed754de2d66084 Vijai Kumar K 2019-01-23 270 return info->irq;
4ed754de2d66084 Vijai Kumar K 2019-01-23 271 }
ad9fa2c3d4319fb Krzysztof Kozlowski 2020-08-11 272 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 273
4ed754de2d66084 Vijai Kumar K 2019-01-23 274 ret = devm_request_threaded_irq(dev, info->irq, NULL,
4ed754de2d66084 Vijai Kumar K 2019-01-23 275 ptn5150_irq_handler,
4ed754de2d66084 Vijai Kumar K 2019-01-23 276 IRQF_TRIGGER_FALLING |
4ed754de2d66084 Vijai Kumar K 2019-01-23 277 IRQF_ONESHOT,
4ed754de2d66084 Vijai Kumar K 2019-01-23 278 i2c->name, info);
4ed754de2d66084 Vijai Kumar K 2019-01-23 279 if (ret < 0) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 280 dev_err(dev, "failed to request handler for INTB IRQ\n");
4ed754de2d66084 Vijai Kumar K 2019-01-23 281 return ret;
4ed754de2d66084 Vijai Kumar K 2019-01-23 282 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 283
4ed754de2d66084 Vijai Kumar K 2019-01-23 284 /* Allocate extcon device */
4ed754de2d66084 Vijai Kumar K 2019-01-23 285 info->edev = devm_extcon_dev_allocate(info->dev, ptn5150_extcon_cable);
4ed754de2d66084 Vijai Kumar K 2019-01-23 286 if (IS_ERR(info->edev)) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 287 dev_err(info->dev, "failed to allocate memory for extcon\n");
4ed754de2d66084 Vijai Kumar K 2019-01-23 288 return -ENOMEM;
4ed754de2d66084 Vijai Kumar K 2019-01-23 289 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 290
4ed754de2d66084 Vijai Kumar K 2019-01-23 291 /* Register extcon device */
4ed754de2d66084 Vijai Kumar K 2019-01-23 292 ret = devm_extcon_dev_register(info->dev, info->edev);
4ed754de2d66084 Vijai Kumar K 2019-01-23 293 if (ret) {
4ed754de2d66084 Vijai Kumar K 2019-01-23 294 dev_err(info->dev, "failed to register extcon device\n");
4ed754de2d66084 Vijai Kumar K 2019-01-23 295 return ret;
4ed754de2d66084 Vijai Kumar K 2019-01-23 296 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 297
4ed754de2d66084 Vijai Kumar K 2019-01-23 298 /* Initialize PTN5150 device and print vendor id and version id */
4ed754de2d66084 Vijai Kumar K 2019-01-23 299 ret = ptn5150_init_dev_type(info);
4ed754de2d66084 Vijai Kumar K 2019-01-23 300 if (ret)
4ed754de2d66084 Vijai Kumar K 2019-01-23 301 return -EINVAL;
4ed754de2d66084 Vijai Kumar K 2019-01-23 302
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 303 /*
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 304 * Update current extcon state if for example OTG connection was there
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 305 * before the probe
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 306 */
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 307 mutex_lock(&info->mutex);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 @308 ptn5150_check_state(info);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 @309 mutex_unlock(&info->mutex);
a6e6203e71c9574 Krzysztof Kozlowski 2020-08-12 310
4ed754de2d66084 Vijai Kumar K 2019-01-23 311 return 0;
4ed754de2d66084 Vijai Kumar K 2019-01-23 312 }
4ed754de2d66084 Vijai Kumar K 2019-01-23 313
:::::: The code at line 167 was first introduced by commit
:::::: 4ed754de2d66084d4a7785f565d7c42ad89a3ea9 extcon: Add support for ptn5150 extcon driver
:::::: TO: Vijai Kumar K <vijaikumar.kanagarajan(a)gmail.com>
:::::: CC: Chanwoo Choi <cw00.choi(a)samsung.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month