arch/sh/boot/compressed/misc.c:118:6: warning: no previous prototype for 'arch_ftrace_ops_list_func'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d2f38a3c6507b2520101f9a3807ed98f1bdc545a
commit: 17b251a290ba84a0c2c5c82df9596cb2e7207ca6 ftrace/sh: Add arch_ftrace_ops_list_func stub to have compressed image still link
date: 13 days ago
config: sh-buildonly-randconfig-r001-20211109 (attached as .config)
compiler: sh4-linux-gcc (GCC) 11.2.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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 17b251a290ba84a0c2c5c82df9596cb2e7207ca6
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
arch/sh/boot/compressed/misc.c:109:6: warning: no previous prototype for '__stack_chk_fail' [-Wmissing-prototypes]
109 | void __stack_chk_fail(void)
| ^~~~~~~~~~~~~~~~
arch/sh/boot/compressed/misc.c:115:6: warning: no previous prototype for 'ftrace_stub' [-Wmissing-prototypes]
115 | void ftrace_stub(void)
| ^~~~~~~~~~~
>> arch/sh/boot/compressed/misc.c:118:6: warning: no previous prototype for 'arch_ftrace_ops_list_func' [-Wmissing-prototypes]
118 | void arch_ftrace_ops_list_func(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
arch/sh/boot/compressed/misc.c:128:6: warning: no previous prototype for 'decompress_kernel' [-Wmissing-prototypes]
128 | void decompress_kernel(void)
| ^~~~~~~~~~~~~~~~~
vim +/arch_ftrace_ops_list_func +118 arch/sh/boot/compressed/misc.c
113
114 /* Needed because vmlinux.lds.h references this */
115 void ftrace_stub(void)
116 {
117 }
> 118 void arch_ftrace_ops_list_func(void)
119 {
120 }
121
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
drivers/hv/hv_common.c:61:21: 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: d2f38a3c6507b2520101f9a3807ed98f1bdc545a
commit: afca4d95dd7d7936d46a0ff02169cc40f534a6a3 Drivers: hv: Make portions of Hyper-V init code be arch neutral
date: 4 months ago
config: x86_64-randconfig-s022-20211027 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout afca4d95dd7d7936d46a0ff02169cc40f534a6a3
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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/hv/hv_common.c:61:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_output_arg @@
drivers/hv/hv_common.c:61:21: sparse: expected void [noderef] __percpu *__pdata
drivers/hv/hv_common.c:61:21: sparse: got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_output_arg
>> drivers/hv/hv_common.c:64:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_input_arg @@
drivers/hv/hv_common.c:64:21: sparse: expected void [noderef] __percpu *__pdata
drivers/hv/hv_common.c:64:21: sparse: got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_input_arg
>> drivers/hv/hv_common.c:78:31: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_input_arg @@ got void *[noderef] __percpu * @@
drivers/hv/hv_common.c:78:31: sparse: expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_input_arg
drivers/hv/hv_common.c:78:31: sparse: got void *[noderef] __percpu *
>> drivers/hv/hv_common.c:83:40: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_output_arg @@ got void *[noderef] __percpu * @@
drivers/hv/hv_common.c:83:40: sparse: expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_output_arg
drivers/hv/hv_common.c:83:40: sparse: got void *[noderef] __percpu *
drivers/hv/hv_common.c:116:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:116:29: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:116:29: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:122:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:122:38: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:122:38: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:144:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:144:29: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:144:29: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:149:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:149:38: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:149:38: sparse: got void [noderef] __percpu **
vim +61 drivers/hv/hv_common.c
49
50 /*
51 * Hyper-V specific initialization and shutdown code that is
52 * common across all architectures. Called from architecture
53 * specific initialization functions.
54 */
55
56 void __init hv_common_free(void)
57 {
58 kfree(hv_vp_index);
59 hv_vp_index = NULL;
60
> 61 free_percpu(hyperv_pcpu_output_arg);
62 hyperv_pcpu_output_arg = NULL;
63
> 64 free_percpu(hyperv_pcpu_input_arg);
65 hyperv_pcpu_input_arg = NULL;
66 }
67
68 int __init hv_common_init(void)
69 {
70 int i;
71
72 /*
73 * Allocate the per-CPU state for the hypercall input arg.
74 * If this allocation fails, we will not be able to setup
75 * (per-CPU) hypercall input page and thus this failure is
76 * fatal on Hyper-V.
77 */
> 78 hyperv_pcpu_input_arg = alloc_percpu(void *);
79 BUG_ON(!hyperv_pcpu_input_arg);
80
81 /* Allocate the per-CPU state for output arg for root */
82 if (hv_root_partition) {
> 83 hyperv_pcpu_output_arg = alloc_percpu(void *);
84 BUG_ON(!hyperv_pcpu_output_arg);
85 }
86
87 hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index),
88 GFP_KERNEL);
89 if (!hv_vp_index) {
90 hv_common_free();
91 return -ENOMEM;
92 }
93
94 for (i = 0; i < num_possible_cpus(); i++)
95 hv_vp_index[i] = VP_INVAL;
96
97 return 0;
98 }
99
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
[djwong-xfs:zero-initialize-pmem-5.16 18/28] fs/xfs/libxfs/xfs_ialloc_btree.c:552:53: sparse: sparse: cast truncates bits from constant value (100000000 becomes 0)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git zero-initialize-pmem-5.16
head: 34b80c3d1203abd5fd64242ef25898c7d64166ca
commit: c0ef00d1e835bfd24399aaa069b2b608dd60b485 [18/28] xfs: check absolute maximum nlevels for each btree type
config: csky-randconfig-s032-20211008 (attached as .config)
compiler: csky-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git fetch --no-tags djwong-xfs zero-initialize-pmem-5.16
git checkout c0ef00d1e835bfd24399aaa069b2b608dd60b485
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=csky SHELL=/bin/bash fs/xfs/ mm/
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 >>)
fs/xfs/libxfs/xfs_ialloc_btree.c: note: in included file (through include/linux/bitops.h, include/linux/kernel.h, include/linux/list.h, ...):
arch/csky/include/asm/bitops.h:77:9: sparse: sparse: preprocessor token __clear_bit redefined
fs/xfs/libxfs/xfs_ialloc_btree.c: note: in included file (through arch/csky/include/asm/bitops.h, include/linux/bitops.h, include/linux/kernel.h, ...):
include/asm-generic/bitops/non-atomic.h:34:9: sparse: this was the original definition
>> fs/xfs/libxfs/xfs_ialloc_btree.c:552:53: sparse: sparse: cast truncates bits from constant value (100000000 becomes 0)
vim +552 fs/xfs/libxfs/xfs_ialloc_btree.c
543
544 unsigned int
545 xfs_inobt_absolute_maxlevels(void)
546 {
547 unsigned int minrecs[2];
548
549 xfs_btree_absolute_minrecs(minrecs, 0, sizeof(xfs_inobt_rec_t),
550 sizeof(xfs_inobt_key_t) + sizeof(xfs_inobt_ptr_t));
551
> 552 return xfs_btree_compute_maxlevels(minrecs, XFS_MAX_AG_INODES);
553 }
554
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d2f38a3c6507b2520101f9a3807ed98f1bdc545a
commit: e188f3330a13df904d77003846eafd3edf99009d ARC: cmpxchg/xchg: rewrite as macros to make type safe
date: 3 months ago
config: arc-randconfig-s032-20211025 (attached as .config)
compiler: arc-elf-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout e188f3330a13df904d77003846eafd3edf99009d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash arch/arc/kernel/
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 >>)
arch/arc/kernel/smp.c:39:20: sparse: sparse: symbol 'secondary_idle_tsk' was not declared. Should it be static?
arch/arc/kernel/smp.c:142:6: sparse: sparse: symbol 'arc_platform_smp_wait_to_boot' was not declared. Should it be static?
arch/arc/kernel/smp.c:164:6: sparse: sparse: symbol 'start_kernel_secondary' was not declared. Should it be static?
arch/arc/kernel/smp.c:264:48: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned long [noderef] __percpu *ipi_data_ptr @@ got unsigned long * @@
arch/arc/kernel/smp.c:264:48: sparse: expected unsigned long [noderef] __percpu *ipi_data_ptr
arch/arc/kernel/smp.c:264:48: sparse: got unsigned long *
arch/arc/kernel/smp.c:279:18: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile *v @@ got unsigned long [noderef] __percpu *__ai_ptr @@
arch/arc/kernel/smp.c:279:18: sparse: expected void const volatile *v
arch/arc/kernel/smp.c:279:18: sparse: got unsigned long [noderef] __percpu *__ai_ptr
arch/arc/kernel/smp.c:277:29: sparse: sparse: cast removes address space '__percpu' of expression
arch/arc/kernel/smp.c:362:13: sparse: sparse: symbol 'do_IPI' was not declared. Should it be static?
arch/arc/kernel/smp.c:413:72: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected void [noderef] __percpu *percpu_dev_id @@ got int *dev @@
arch/arc/kernel/smp.c:413:72: sparse: expected void [noderef] __percpu *percpu_dev_id
arch/arc/kernel/smp.c:413:72: sparse: got int *dev
>> arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
>> arch/arc/kernel/smp.c:279:18: sparse: sparse: dereference of noderef expression
vim +279 arch/arc/kernel/smp.c
41195d236e8445 Vineet Gupta 2013-01-18 261
ddf84433f411b6 Vineet Gupta 2013-11-25 262 static void ipi_send_msg_one(int cpu, enum ipi_msg_type msg)
41195d236e8445 Vineet Gupta 2013-01-18 263 {
f2a4aa5646687f Vineet Gupta 2013-11-26 264 unsigned long __percpu *ipi_data_ptr = per_cpu_ptr(&ipi_data, cpu);
d8e8c7dda11f5d Vineet Gupta 2013-11-28 265 unsigned long old, new;
41195d236e8445 Vineet Gupta 2013-01-18 266 unsigned long flags;
41195d236e8445 Vineet Gupta 2013-01-18 267
f2a4aa5646687f Vineet Gupta 2013-11-26 268 pr_debug("%d Sending msg [%d] to %d\n", smp_processor_id(), msg, cpu);
f2a4aa5646687f Vineet Gupta 2013-11-26 269
41195d236e8445 Vineet Gupta 2013-01-18 270 local_irq_save(flags);
41195d236e8445 Vineet Gupta 2013-01-18 271
d8e8c7dda11f5d Vineet Gupta 2013-11-28 272 /*
d8e8c7dda11f5d Vineet Gupta 2013-11-28 273 * Atomically write new msg bit (in case others are writing too),
d8e8c7dda11f5d Vineet Gupta 2013-11-28 274 * and read back old value
d8e8c7dda11f5d Vineet Gupta 2013-11-28 275 */
d8e8c7dda11f5d Vineet Gupta 2013-11-28 276 do {
6aa7de059173a9 Mark Rutland 2017-10-23 277 new = old = READ_ONCE(*ipi_data_ptr);
d8e8c7dda11f5d Vineet Gupta 2013-11-28 278 new |= 1U << msg;
d8e8c7dda11f5d Vineet Gupta 2013-11-28 @279 } while (cmpxchg(ipi_data_ptr, old, new) != old);
41195d236e8445 Vineet Gupta 2013-01-18 280
d8e8c7dda11f5d Vineet Gupta 2013-11-28 281 /*
d8e8c7dda11f5d Vineet Gupta 2013-11-28 282 * Call the platform specific IPI kick function, but avoid if possible:
d8e8c7dda11f5d Vineet Gupta 2013-11-28 283 * Only do so if there's no pending msg from other concurrent sender(s).
82a423053eb3cf Changcheng Deng 2021-08-14 284 * Otherwise, receiver will see this msg as well when it takes the
d8e8c7dda11f5d Vineet Gupta 2013-11-28 285 * IPI corresponding to that msg. This is true, even if it is already in
d8e8c7dda11f5d Vineet Gupta 2013-11-28 286 * IPI handler, because !@old means it has not yet dequeued the msg(s)
d8e8c7dda11f5d Vineet Gupta 2013-11-28 287 * so @new msg can be a free-loader
d8e8c7dda11f5d Vineet Gupta 2013-11-28 288 */
d8e8c7dda11f5d Vineet Gupta 2013-11-28 289 if (plat_smp_ops.ipi_send && !old)
ddf84433f411b6 Vineet Gupta 2013-11-25 290 plat_smp_ops.ipi_send(cpu);
41195d236e8445 Vineet Gupta 2013-01-18 291
41195d236e8445 Vineet Gupta 2013-01-18 292 local_irq_restore(flags);
41195d236e8445 Vineet Gupta 2013-01-18 293 }
41195d236e8445 Vineet Gupta 2013-01-18 294
:::::: The code at line 279 was first introduced by commit
:::::: d8e8c7dda11f5d5cf90495f2e89d917a83509bc0 ARC: [SMP] optimize IPI send and receive
:::::: TO: Vineet Gupta <vgupta(a)synopsys.com>
:::::: CC: Vineet Gupta <vgupta(a)synopsys.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
[linux-next:master 13255/13500] fs/udf/dir.c:78:18: warning: cast from pointer to integer of different size
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: c8109c2ba35e9bfd8a55087ffb1f42cc0dcf71e6
commit: 39a464de961f256197934d36aa5dda546cba8ed0 [13255/13500] udf: Fix crash after seekdir
config: i386-debian-10.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 39a464de961f256197934d36aa5dda546cba8ed0
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
fs/udf/dir.c: In function 'udf_readdir':
>> fs/udf/dir.c:78:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
78 | if (ctx->pos != (loff_t)file->private_data) {
| ^
>> fs/udf/dir.c:211:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
211 | file->private_data = (void *)ctx->pos;
| ^
vim +78 fs/udf/dir.c
37
38 static int udf_readdir(struct file *file, struct dir_context *ctx)
39 {
40 struct inode *dir = file_inode(file);
41 struct udf_inode_info *iinfo = UDF_I(dir);
42 struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL};
43 struct fileIdentDesc *fi = NULL;
44 struct fileIdentDesc cfi;
45 udf_pblk_t block, iblock;
46 loff_t nf_pos, emit_pos;
47 int flen;
48 unsigned char *fname = NULL, *copy_name = NULL;
49 unsigned char *nameptr;
50 uint16_t liu;
51 uint8_t lfi;
52 loff_t size = udf_ext0_offset(dir) + dir->i_size;
53 struct buffer_head *tmp, *bha[16];
54 struct kernel_lb_addr eloc;
55 uint32_t elen;
56 sector_t offset;
57 int i, num, ret = 0;
58 struct extent_position epos = { NULL, 0, {0, 0} };
59 struct super_block *sb = dir->i_sb;
60
61 if (ctx->pos == 0) {
62 if (!dir_emit_dot(file, ctx))
63 return 0;
64 ctx->pos = 1;
65 }
66 nf_pos = (ctx->pos - 1) << 2;
67 if (nf_pos >= size)
68 goto out;
69
70 /*
71 * Did our position change since last readdir (likely lseek was
72 * called)? We need to verify the position correctly points at the
73 * beginning of some dir entry so that the directory parsing code does
74 * not get confused. Since UDF does not have any reliable way of
75 * identifying beginning of dir entry (names are under user control),
76 * we need to scan the directory from the beginning.
77 */
> 78 if (ctx->pos != (loff_t)file->private_data) {
79 emit_pos = nf_pos;
80 nf_pos = 0;
81 }
82
83 fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
84 if (!fname) {
85 ret = -ENOMEM;
86 goto out;
87 }
88
89 if (nf_pos == 0)
90 nf_pos = udf_ext0_offset(dir);
91
92 fibh.soffset = fibh.eoffset = nf_pos & (sb->s_blocksize - 1);
93 if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
94 if (inode_bmap(dir, nf_pos >> sb->s_blocksize_bits,
95 &epos, &eloc, &elen, &offset)
96 != (EXT_RECORDED_ALLOCATED >> 30)) {
97 ret = -ENOENT;
98 goto out;
99 }
100 block = udf_get_lb_pblock(sb, &eloc, offset);
101 if ((++offset << sb->s_blocksize_bits) < elen) {
102 if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
103 epos.offset -= sizeof(struct short_ad);
104 else if (iinfo->i_alloc_type ==
105 ICBTAG_FLAG_AD_LONG)
106 epos.offset -= sizeof(struct long_ad);
107 } else {
108 offset = 0;
109 }
110
111 if (!(fibh.sbh = fibh.ebh = udf_tread(sb, block))) {
112 ret = -EIO;
113 goto out;
114 }
115
116 if (!(offset & ((16 >> (sb->s_blocksize_bits - 9)) - 1))) {
117 i = 16 >> (sb->s_blocksize_bits - 9);
118 if (i + offset > (elen >> sb->s_blocksize_bits))
119 i = (elen >> sb->s_blocksize_bits) - offset;
120 for (num = 0; i > 0; i--) {
121 block = udf_get_lb_pblock(sb, &eloc, offset + i);
122 tmp = udf_tgetblk(sb, block);
123 if (tmp && !buffer_uptodate(tmp) && !buffer_locked(tmp))
124 bha[num++] = tmp;
125 else
126 brelse(tmp);
127 }
128 if (num) {
129 ll_rw_block(REQ_OP_READ, REQ_RAHEAD, num, bha);
130 for (i = 0; i < num; i++)
131 brelse(bha[i]);
132 }
133 }
134 }
135
136 while (nf_pos < size) {
137 struct kernel_lb_addr tloc;
138 loff_t cur_pos = nf_pos;
139
140 /* Update file position only if we got past the current one */
141 if (nf_pos >= emit_pos)
142 ctx->pos = (nf_pos >> 2) + 1;
143
144 fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc,
145 &elen, &offset);
146 if (!fi)
147 goto out;
148 /* Still not at offset where user asked us to read from? */
149 if (cur_pos < emit_pos)
150 continue;
151
152 liu = le16_to_cpu(cfi.lengthOfImpUse);
153 lfi = cfi.lengthFileIdent;
154
155 if (fibh.sbh == fibh.ebh) {
156 nameptr = udf_get_fi_ident(fi);
157 } else {
158 int poffset; /* Unpaded ending offset */
159
160 poffset = fibh.soffset + sizeof(struct fileIdentDesc) + liu + lfi;
161
162 if (poffset >= lfi) {
163 nameptr = (char *)(fibh.ebh->b_data + poffset - lfi);
164 } else {
165 if (!copy_name) {
166 copy_name = kmalloc(UDF_NAME_LEN,
167 GFP_NOFS);
168 if (!copy_name) {
169 ret = -ENOMEM;
170 goto out;
171 }
172 }
173 nameptr = copy_name;
174 memcpy(nameptr, udf_get_fi_ident(fi),
175 lfi - poffset);
176 memcpy(nameptr + lfi - poffset,
177 fibh.ebh->b_data, poffset);
178 }
179 }
180
181 if ((cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) {
182 if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNDELETE))
183 continue;
184 }
185
186 if ((cfi.fileCharacteristics & FID_FILE_CHAR_HIDDEN) != 0) {
187 if (!UDF_QUERY_FLAG(sb, UDF_FLAG_UNHIDE))
188 continue;
189 }
190
191 if (cfi.fileCharacteristics & FID_FILE_CHAR_PARENT) {
192 if (!dir_emit_dotdot(file, ctx))
193 goto out;
194 continue;
195 }
196
197 flen = udf_get_filename(sb, nameptr, lfi, fname, UDF_NAME_LEN);
198 if (flen < 0)
199 continue;
200
201 tloc = lelb_to_cpu(cfi.icb.extLocation);
202 iblock = udf_get_lb_pblock(sb, &tloc, 0);
203 if (!dir_emit(ctx, fname, flen, iblock, DT_UNKNOWN))
204 goto out;
205 } /* end while */
206
207 ctx->pos = (nf_pos >> 2) + 1;
208
209 out:
210 /* Store position where we've ended */
> 211 file->private_data = (void *)ctx->pos;
212 if (fibh.sbh != fibh.ebh)
213 brelse(fibh.ebh);
214 brelse(fibh.sbh);
215 brelse(epos.bh);
216 kfree(fname);
217 kfree(copy_name);
218
219 return ret;
220 }
221
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
drivers/pci/pci.c:1029:24: sparse: sparse: incorrect type in return expression (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d2f38a3c6507b2520101f9a3807ed98f1bdc545a
commit: d5b0d88385f5a5f865f6761d7c93e373221914a4 PCI: PM: Do not use pci_platform_pm_ops for Intel MID PM
date: 6 weeks ago
config: i386-randconfig-s031-20210929 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout d5b0d88385f5a5f865f6761d7c93e373221914a4
# 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/pci/pci.c:1078:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1078:21: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1078:31: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1078:39: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1087:35: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1087:54: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1088:19: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1088:37: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1118:23: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:1118:23: sparse: left side has type unsigned short
drivers/pci/pci.c:1118:23: sparse: right side has type restricted pci_power_t
drivers/pci/pci.c:1123:57: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1145:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted pci_power_t [usertype] current_state @@ got int @@
drivers/pci/pci.c:1145:28: sparse: expected restricted pci_power_t [usertype] current_state
drivers/pci/pci.c:1145:28: sparse: got int
drivers/pci/pci.c:1194:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted pci_power_t [usertype] current_state @@ got int @@
drivers/pci/pci.c:1194:36: sparse: expected restricted pci_power_t [usertype] current_state
drivers/pci/pci.c:1194:36: sparse: got int
drivers/pci/pci.c:1366:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1366:21: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1368:18: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1368:26: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1391:13: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1391:22: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1398:46: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1398:54: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:1756:38: sparse: sparse: array of flexible structures
drivers/pci/pci.c:2335:44: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2643:60: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2644:30: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2837:20: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2837:38: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2860:49: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:2860:67: sparse: sparse: restricted pci_power_t degrades to integer
drivers/pci/pci.c:4789:13: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:4789:13: sparse: left side has type unsigned short
drivers/pci/pci.c:4789:13: sparse: right side has type restricted pci_power_t
drivers/pci/pci.c:4794:13: sparse: sparse: invalid assignment: |=
drivers/pci/pci.c:4794:13: sparse: left side has type unsigned short
drivers/pci/pci.c:4794:13: sparse: right side has type restricted pci_power_t
>> drivers/pci/pci.c:1029:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted pci_power_t [usertype] @@
drivers/pci/pci.c:1029:24: sparse: expected int
drivers/pci/pci.c:1029:24: sparse: got restricted pci_power_t [usertype]
>> drivers/pci/pci.c:1029:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected int @@ got restricted pci_power_t [usertype] @@
drivers/pci/pci.c:1029:24: sparse: expected int
drivers/pci/pci.c:1029:24: sparse: got restricted pci_power_t [usertype]
vim +1029 drivers/pci/pci.c
1025
1026 static inline int platform_pci_set_wakeup(struct pci_dev *dev, bool enable)
1027 {
1028 if (pci_use_mid_pm())
> 1029 return PCI_POWER_ERROR;
1030
1031 return pci_platform_pm ?
1032 pci_platform_pm->set_wakeup(dev, enable) : -ENODEV;
1033 }
1034
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
[oracle-dtrace:v1/5.15 30/35] net/ipv4/raw.c:358:21: warning: variable 'dropreason' set but not used
by kernel test robot
tree: https://github.com/oracle/dtrace-linux-kernel v1/5.15
head: 0fee66d7ce96317146609675767971d0f35c3e74
commit: 7ed2333cfd691c676b0adfe951d92244f1ef5128 [30/35] dtrace: add SDT probes
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.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
# https://github.com/oracle/dtrace-linux-kernel/commit/7ed2333cfd691c676b0a...
git remote add oracle-dtrace https://github.com/oracle/dtrace-linux-kernel
git fetch --no-tags oracle-dtrace v1/5.15
git checkout 7ed2333cfd691c676b0adfe951d92244f1ef5128
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
net/ipv4/raw.c: In function 'raw_send_hdrinc':
>> net/ipv4/raw.c:358:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
358 | const char *dropreason;
| ^~~~~~~~~~
--
net/ipv4/ip_input.c: In function 'ip_rcv_options':
>> net/ipv4/ip_input.c:273:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
273 | const char *dropreason;
| ^~~~~~~~~~
net/ipv4/ip_input.c: In function 'ip_rcv_core':
net/ipv4/ip_input.c:468:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
468 | const char *dropreason = "header invalid";
| ^~~~~~~~~~
--
net/ipv4/ip_output.c: In function '__ip_append_data':
>> net/ipv4/ip_output.c:979:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
979 | const char *dropreason;
| ^~~~~~~~~~
net/ipv4/ip_output.c: In function 'ip_append_page':
net/ipv4/ip_output.c:1366:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
1366 | const char *dropreason;
| ^~~~~~~~~~
>> net/ipv4/ip_output.c:1365:23: warning: variable 'iph' set but not used [-Wunused-but-set-variable]
1365 | struct iphdr *iph;
| ^~~
vim +/dropreason +358 net/ipv4/raw.c
344
345 static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4,
346 struct msghdr *msg, size_t length,
347 struct rtable **rtp, unsigned int flags,
348 const struct sockcm_cookie *sockc)
349 {
350 struct inet_sock *inet = inet_sk(sk);
351 struct net *net = sock_net(sk);
352 struct iphdr *iph;
353 struct sk_buff *skb = NULL;
354 unsigned int iphlen;
355 int err;
356 struct rtable *rt = *rtp;
357 int hlen, tlen;
> 358 const char *dropreason;
359
360 if (length > rt->dst.dev->mtu) {
361 ip_local_error(sk, EMSGSIZE, fl4->daddr, inet->inet_dport,
362 rt->dst.dev->mtu);
363 dropreason = "packet too big";
364 err = -EMSGSIZE;
365 goto trace_drop;
366 }
367 if (length < sizeof(struct iphdr)) {
368 dropreason = "packet too short";
369 err = -EINVAL;
370 goto trace_drop;
371 }
372
373 if (flags&MSG_PROBE)
374 goto out;
375
376 hlen = LL_RESERVED_SPACE(rt->dst.dev);
377 tlen = rt->dst.dev->needed_tailroom;
378 skb = sock_alloc_send_skb(sk,
379 length + hlen + tlen + 15,
380 flags & MSG_DONTWAIT, &err);
381 if (!skb) {
382 dropreason = "out of memory";
383 goto error;
384 }
385 skb_reserve(skb, hlen);
386
387 skb->priority = sk->sk_priority;
388 skb->mark = sockc->mark;
389 skb->tstamp = sockc->transmit_time;
390 skb_dst_set(skb, &rt->dst);
391 *rtp = NULL;
392
393 skb_reset_network_header(skb);
394 iph = ip_hdr(skb);
395 skb_put(skb, length);
396
397 skb->ip_summed = CHECKSUM_NONE;
398
399 skb_setup_tx_timestamp(skb, sockc->tsflags);
400
401 if (flags & MSG_CONFIRM)
402 skb_set_dst_pending_confirm(skb, 1);
403
404 skb->transport_header = skb->network_header;
405 err = -EFAULT;
406 if (memcpy_from_msg(iph, msg, length)) {
407 dropreason = "could not copy msg";
408 goto error_free;
409 }
410
411 iphlen = iph->ihl * 4;
412
413 /*
414 * We don't want to modify the ip header, but we do need to
415 * be sure that it won't cause problems later along the network
416 * stack. Specifically we want to make sure that iph->ihl is a
417 * sane value. If ihl points beyond the length of the buffer passed
418 * in, reject the frame as invalid
419 */
420 err = -EINVAL;
421 if (iphlen > length) {
422 dropreason = "IP header too big";
423 goto error_free;
424 }
425
426 if (iphlen >= sizeof(*iph)) {
427 if (!iph->saddr)
428 iph->saddr = fl4->saddr;
429 iph->check = 0;
430 iph->tot_len = htons(length);
431 if (!iph->id)
432 ip_select_ident(net, skb, NULL);
433
434 iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
435 skb->transport_header += iphlen;
436 if (iph->protocol == IPPROTO_ICMP &&
437 length >= iphlen + sizeof(struct icmphdr))
438 icmp_out_count(net, ((struct icmphdr *)
439 skb_transport_header(skb))->type);
440 }
441
442 DTRACE_IP(send,
443 struct sk_buff * : pktinfo_t *, skb,
444 struct sock * : csinfo_t *, sk,
445 void_ip_t * : ipinfo_t *, iph,
446 struct net_device * : ifinfo_t *, skb->dev,
447 struct iphdr * : ipv4info_t *, iph,
448 struct ipv6hdr * : ipv6info_t *, NULL);
449
450 err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT,
451 net, sk, skb, NULL, rt->dst.dev,
452 dst_output);
453 if (err > 0)
454 err = net_xmit_errno(err);
455 if (err) {
456 dropreason = "device dropping packets of this priority";
457 goto error;
458 }
459 out:
460 return 0;
461
462 error_free:
463 kfree_skb(skb);
464 skb = NULL;
465 error:
466 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
467 trace_drop:
468 DTRACE_IP(drop__out,
469 struct sk_buff * : pktinfo_t *, skb,
470 struct sock * : csinfo_t *, skb ? skb->sk : NULL,
471 void_ip_t * : ipinfo_t *, skb ? ip_hdr(skb) : NULL,
472 struct net_device * : ifinfo_t *, skb ? skb->dev : NULL,
473 struct iphdr * : ipv4info_t *, skb ? ip_hdr(skb) : NULL,
474 struct ipv6hdr * : ipv6info_t *, NULL,
475 const char * : string, dropreason);
476 if (err == -ENOBUFS && !inet->recverr)
477 err = 0;
478 return err;
479 }
480
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks
Re: [PATCH v3 2/2] thermal: add a virtual sensor to aggregate temperatures
by kernel test robot
Hi Alexandre,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on rafael-pm/thermal]
[also build test WARNING on v5.15 next-20211108]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Alexandre-Bailon/Add-a-generic-v...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal
config: i386-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/be0e058f9a82f32140e4e96cf67a3e084...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexandre-Bailon/Add-a-generic-virtual-thermal-sensor/20211029-231137
git checkout be0e058f9a82f32140e4e96cf67a3e0842da9f70
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/thermal/virtual_thermal_sensor.c:73:5: warning: no previous prototype for 'virtual_thermal_sensor_get_module' [-Wmissing-prototypes]
73 | int virtual_thermal_sensor_get_module(struct virtual_thermal_zone_device *zone,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/thermal/virtual_thermal_sensor.c:102:6: warning: no previous prototype for 'virtual_thermal_sensor_put_modules' [-Wmissing-prototypes]
102 | void virtual_thermal_sensor_put_modules(struct virtual_thermal_sensor *sensor)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/virtual_thermal_sensor_get_module +73 drivers/thermal/virtual_thermal_sensor.c
72
> 73 int virtual_thermal_sensor_get_module(struct virtual_thermal_zone_device *zone,
74 const char *name)
75 {
76 struct platform_device *sensor_pdev;
77 struct device_node *node;
78
79 node = of_find_node_by_name(NULL, name);
80 if (!node)
81 return -ENODEV;
82
83 node = of_parse_phandle(node, "thermal-sensors", 0);
84 if (!node)
85 return -ENODEV;
86
87 sensor_pdev = of_find_device_by_node(node);
88 if (!sensor_pdev)
89 return -ENODEV;
90
91 if (!sensor_pdev->dev.driver)
92 return -EPROBE_DEFER;
93
94 if (!try_module_get(sensor_pdev->dev.driver->owner))
95 return -ENODEV;
96
97 zone->owner = sensor_pdev->dev.driver->owner;
98
99 return 0;
100 }
101
> 102 void virtual_thermal_sensor_put_modules(struct virtual_thermal_sensor *sensor)
103 {
104 int i;
105
106 for (i = 0; i < sensor->count; i++) {
107 if (sensor->zones[i].zone)
108 module_put(sensor->zones[i].owner);
109 }
110 }
111
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 2 weeks