Re: sound/soc/codecs/zl38060.c:614:34: warning: unused variable 'zl38_dt_ids'
by Mark Brown
On Thu, Jul 09, 2020 at 07:41:00PM -0700, Nathan Chancellor wrote:
> When CONFIG_SND_SOC_ZL38060 is y, MODULE_DEVICE_TABLE expands to nothing
> so zl38_dt_ids will be unused. This is a pretty common construct in the
> kernel and the only way I can think of to resolve this through the code
> is by adding __used annotations to all of these variables, which I think
> is overkill for this.
> Personally, I think this warning should be downgraded to W=2, thoughts?
We've had that warning available for ever, we shouldn't need to disable
it now. I had thought there was supposed to be magic which caused
of_match_ptr() to make things look referenced when !OF but don't seem to
actually see any sign of it. The other thing is to just have ifdefs
around the table.
2 years, 2 months
[vincent.guittot:sched/pelt 1/2] kernel/sched/fair.c:7662:32: sparse: sparse: incompatible types in comparison expression (different type sizes):
by kernel test robot
tree: https://git.linaro.org/people/vincent.guittot/kernel.git sched/pelt
head: cc807c0b8d03785da906a6a8436be5838bfe9d54
commit: a057128bc3087ebc9505454a1b5d7a4ae35c6e04 [1/2] sched/fair: handle case of task_h_load() returning 0
config: x86_64-randconfig-s021-20200710 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-37-gc9676a3b-dirty
git checkout a057128bc3087ebc9505454a1b5d7a4ae35c6e04
# 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 >>)
kernel/sched/fair.c:881:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sched_entity *se @@ got struct sched_entity [noderef] <asn:4> * @@
kernel/sched/fair.c:881:34: sparse: expected struct sched_entity *se
kernel/sched/fair.c:881:34: sparse: got struct sched_entity [noderef] <asn:4> *
kernel/sched/fair.c:2509:13: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *tsk @@ got struct task_struct [noderef] <asn:4> * @@
kernel/sched/fair.c:2509:13: sparse: expected struct task_struct *tsk
kernel/sched/fair.c:2509:13: sparse: got struct task_struct [noderef] <asn:4> *
kernel/sched/fair.c:10517:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:10517:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:10517:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:4889:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:4889:22: sparse: struct task_struct [noderef] <asn:4> *
kernel/sched/fair.c:4889:22: sparse: struct task_struct *
kernel/sched/fair.c:6576:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:6576:20: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:6576:20: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:6695:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] tmp @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:6695:9: sparse: expected struct sched_domain *[assigned] tmp
kernel/sched/fair.c:6695:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:6894:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] <asn:4> *curr @@
kernel/sched/fair.c:6894:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:6894:38: sparse: got struct task_struct [noderef] <asn:4> *curr
kernel/sched/fair.c:7145:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct task_struct *curr @@ got struct task_struct [noderef] <asn:4> *curr @@
kernel/sched/fair.c:7145:38: sparse: expected struct task_struct *curr
kernel/sched/fair.c:7145:38: sparse: got struct task_struct [noderef] <asn:4> *curr
>> kernel/sched/fair.c:7662:32: sparse: sparse: incompatible types in comparison expression (different type sizes):
>> kernel/sched/fair.c:7662:32: sparse: unsigned long *
>> kernel/sched/fair.c:7662:32: sparse: int *
kernel/sched/fair.c:8110:40: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *child @@ got struct sched_domain [noderef] <asn:4> *child @@
kernel/sched/fair.c:8110:40: sparse: expected struct sched_domain *child
kernel/sched/fair.c:8110:40: sparse: got struct sched_domain [noderef] <asn:4> *child
kernel/sched/fair.c:8603:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:8603:22: sparse: struct task_struct [noderef] <asn:4> *
kernel/sched/fair.c:8603:22: sparse: struct task_struct *
kernel/sched/fair.c:9840:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:9840:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:9840:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:9500:44: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct sched_domain *sd_parent @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:9500:44: sparse: expected struct sched_domain *sd_parent
kernel/sched/fair.c:9500:44: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:9918:9: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct sched_domain *[assigned] sd @@ got struct sched_domain [noderef] <asn:4> *parent @@
kernel/sched/fair.c:9918:9: sparse: expected struct sched_domain *[assigned] sd
kernel/sched/fair.c:9918:9: sparse: got struct sched_domain [noderef] <asn:4> *parent
kernel/sched/fair.c:10718:22: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:10718:22: sparse: struct task_struct [noderef] <asn:4> *
kernel/sched/fair.c:10718:22: sparse: struct task_struct *
kernel/sched/fair.c:10851:30: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/fair.c:10851:30: sparse: struct task_struct [noderef] <asn:4> *
kernel/sched/fair.c:10851:30: sparse: struct task_struct *
kernel/sched/fair.c:2453:9: sparse: sparse: context imbalance in 'task_numa_placement' - different lock contexts for basic block
kernel/sched/fair.c:3893:30: sparse: sparse: cast to non-scalar
kernel/sched/fair.c:3893:30: sparse: sparse: cast from non-scalar
kernel/sched/fair.c:4569:31: sparse: sparse: marked inline, but without a definition
kernel/sched/sched.h:1817:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
kernel/sched/sched.h:1817:9: sparse: struct task_struct [noderef] <asn:4> *
kernel/sched/sched.h:1817:9: sparse: struct task_struct *
kernel/sched/fair.c:4056:32: sparse: sparse: incompatible types in comparison expression (different type sizes):
kernel/sched/fair.c:4056:32: sparse: unsigned long *
kernel/sched/fair.c:4056:32: sparse: int *
>> kernel/sched/fair.c:4056:32: sparse: sparse: cannot size expression
vim +7662 kernel/sched/fair.c
7609
7610 /*
7611 * detach_tasks() -- tries to detach up to imbalance load/util/tasks from
7612 * busiest_rq, as part of a balancing operation within domain "sd".
7613 *
7614 * Returns number of detached tasks if successful and 0 otherwise.
7615 */
7616 static int detach_tasks(struct lb_env *env)
7617 {
7618 struct list_head *tasks = &env->src_rq->cfs_tasks;
7619 unsigned long util, load;
7620 struct task_struct *p;
7621 int detached = 0;
7622
7623 lockdep_assert_held(&env->src_rq->lock);
7624
7625 if (env->imbalance <= 0)
7626 return 0;
7627
7628 while (!list_empty(tasks)) {
7629 /*
7630 * We don't want to steal all, otherwise we may be treated likewise,
7631 * which could at worst lead to a livelock crash.
7632 */
7633 if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1)
7634 break;
7635
7636 p = list_last_entry(tasks, struct task_struct, se.group_node);
7637
7638 env->loop++;
7639 /* We've more or less seen every task there is, call it quits */
7640 if (env->loop > env->loop_max)
7641 break;
7642
7643 /* take a breather every nr_migrate tasks */
7644 if (env->loop > env->loop_break) {
7645 env->loop_break += sched_nr_migrate_break;
7646 env->flags |= LBF_NEED_BREAK;
7647 break;
7648 }
7649
7650 if (!can_migrate_task(p, env))
7651 goto next;
7652
7653 switch (env->migration_type) {
7654 case migrate_load:
7655 /*
7656 * Depending of the number of CPUs and tasks and the
7657 * cgroup hierarchy, task_h_load() can return a null
7658 * value. Make sure that env->imbalance decreases
7659 * otherwise detach_tasks() will stop only after
7660 * detaching up to loop_max tasks.
7661 */
> 7662 load = max(task_h_load(p), 1);
7663
7664 if (sched_feat(LB_MIN) &&
7665 load < 16 && !env->sd->nr_balance_failed)
7666 goto next;
7667
7668 /*
7669 * Make sure that we don't migrate too much load.
7670 * Nevertheless, let relax the constraint if
7671 * scheduler fails to find a good waiting task to
7672 * migrate.
7673 */
7674 if (load/2 > env->imbalance &&
7675 env->sd->nr_balance_failed <= env->sd->cache_nice_tries)
7676 goto next;
7677
7678 env->imbalance -= load;
7679 break;
7680
7681 case migrate_util:
7682 util = task_util_est(p);
7683
7684 if (util > env->imbalance)
7685 goto next;
7686
7687 env->imbalance -= util;
7688 break;
7689
7690 case migrate_task:
7691 env->imbalance--;
7692 break;
7693
7694 case migrate_misfit:
7695 /* This is not a misfit task */
7696 if (task_fits_capacity(p, capacity_of(env->src_cpu)))
7697 goto next;
7698
7699 env->imbalance = 0;
7700 break;
7701 }
7702
7703 detach_task(p, env);
7704 list_add(&p->se.group_node, &env->tasks);
7705
7706 detached++;
7707
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
ld.lld: error: undefined symbol: __ubsan_handle_load_invalid_value
by kernel test robot
CC: linux-kernel(a)vger.kernel.org
TO: Kees Cook <keescook(a)chromium.org>
CC: Andrew Morton <akpm(a)linux-foundation.org>
CC: Linux Memory Management List <linux-mm(a)kvack.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42f82040ee66db13525dc6f14b8559890b2f4c1c
commit: 8d58f222e85f01da0c0e1fc1e77986c86de889e2 ubsan: disable UBSAN_ALIGNMENT under COMPILE_TEST
date: 9 weeks ago
config: mips-randconfig-r022-20200710 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
git checkout 8d58f222e85f01da0c0e1fc1e77986c86de889e2
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
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 >>):
>> ld.lld: error: undefined symbol: __ubsan_handle_load_invalid_value
>>> referenced by xz_dec_stream.c:775 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:775)
>>> arch/mips/boot/compressed/decompress.o:(decompress_kernel)
>>> referenced by xz_dec_lzma2.c:979 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_lzma2.c:979)
>>> arch/mips/boot/compressed/decompress.o:(xz_dec_lzma2_run)
>>> referenced by xz_dec_lzma2.c:997 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_lzma2.c:997)
>>> arch/mips/boot/compressed/decompress.o:(xz_dec_lzma2_run)
--
>> ld.lld: error: undefined symbol: __ubsan_handle_out_of_bounds
>>> referenced by xz_dec_stream.c:539 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:539)
>>> arch/mips/boot/compressed/decompress.o:(dec_main)
>>> referenced by xz_dec_stream.c:459 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:459)
>>> arch/mips/boot/compressed/decompress.o:(dec_main)
>>> referenced by xz_dec_stream.c:522 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:522)
>>> arch/mips/boot/compressed/decompress.o:(dec_main)
>>> referenced 19 more times
--
>> ld.lld: error: undefined symbol: __ubsan_handle_shift_out_of_bounds
>>> referenced by xz_dec_stream.c:352 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:352)
>>> arch/mips/boot/compressed/decompress.o:(crc32_validate)
>>> referenced by xz_dec_stream.c:187 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_stream.c:187)
>>> arch/mips/boot/compressed/decompress.o:(dec_vli)
>>> referenced by xz_dec_lzma2.c:810 (arch/mips/boot/compressed/../../../../lib/xz/xz_dec_lzma2.c:810)
>>> arch/mips/boot/compressed/decompress.o:(xz_dec_lzma2_run)
>>> referenced 9 more times
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
drivers/i2c/busses/i2c-xgene-slimpro.c:134:9: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42f82040ee66db13525dc6f14b8559890b2f4c1c
commit: a5460b5e5fb82656807840d40d3deaecad094044 READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
date: 3 months ago
config: arm64-randconfig-s031-20200710 (attached as .config)
compiler: aarch64-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-37-gc9676a3b-dirty
git checkout a5460b5e5fb82656807840d40d3deaecad094044
# 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=arm64
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/i2c/busses/i2c-xgene-slimpro.c:131:15: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:131:15: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:131:15: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:131:15: sparse: sparse: cast to restricted __le16
>> drivers/i2c/busses/i2c-xgene-slimpro.c:134:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restricted __le16 [usertype] @@
>> drivers/i2c/busses/i2c-xgene-slimpro.c:134:9: sparse: expected unsigned short volatile
>> drivers/i2c/busses/i2c-xgene-slimpro.c:134:9: sparse: got restricted __le16 [usertype]
>> drivers/i2c/busses/i2c-xgene-slimpro.c:185:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int volatile @@ got restricted __le32 [usertype] @@
>> drivers/i2c/busses/i2c-xgene-slimpro.c:185:9: sparse: expected unsigned int volatile
>> drivers/i2c/busses/i2c-xgene-slimpro.c:185:9: sparse: got restricted __le32 [usertype]
drivers/i2c/busses/i2c-xgene-slimpro.c:188:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restricted __le16 [usertype] @@
drivers/i2c/busses/i2c-xgene-slimpro.c:188:9: sparse: expected unsigned short volatile
drivers/i2c/busses/i2c-xgene-slimpro.c:188:9: sparse: got restricted __le16 [usertype]
drivers/i2c/busses/i2c-xgene-slimpro.c:191:18: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:191:18: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:191:18: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:191:18: sparse: sparse: cast to restricted __le16
drivers/i2c/busses/i2c-xgene-slimpro.c:193:9: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short volatile @@ got restricted __le16 [usertype] @@
drivers/i2c/busses/i2c-xgene-slimpro.c:193:9: sparse: expected unsigned short volatile
drivers/i2c/busses/i2c-xgene-slimpro.c:193:9: sparse: got restricted __le16 [usertype]
drivers/i2c/busses/i2c-xgene-slimpro.c:197:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int volatile @@ got restricted __le32 [usertype] @@
drivers/i2c/busses/i2c-xgene-slimpro.c:197:17: sparse: expected unsigned int volatile
drivers/i2c/busses/i2c-xgene-slimpro.c:197:17: sparse: got restricted __le32 [usertype]
vim +134 drivers/i2c/busses/i2c-xgene-slimpro.c
da24b8240fe6af Hoan Tran 2017-10-30 123
df5da47fe722e3 Hoan Tran 2017-04-24 124 /*
df5da47fe722e3 Hoan Tran 2017-04-24 125 * This function tests and clears a bitmask then returns its old value
df5da47fe722e3 Hoan Tran 2017-04-24 126 */
df5da47fe722e3 Hoan Tran 2017-04-24 127 static u16 xgene_word_tst_and_clr(u16 *addr, u16 mask)
df5da47fe722e3 Hoan Tran 2017-04-24 128 {
df5da47fe722e3 Hoan Tran 2017-04-24 129 u16 ret, val;
df5da47fe722e3 Hoan Tran 2017-04-24 130
df5da47fe722e3 Hoan Tran 2017-04-24 @131 val = le16_to_cpu(READ_ONCE(*addr));
df5da47fe722e3 Hoan Tran 2017-04-24 132 ret = val & mask;
df5da47fe722e3 Hoan Tran 2017-04-24 133 val &= ~mask;
df5da47fe722e3 Hoan Tran 2017-04-24 @134 WRITE_ONCE(*addr, cpu_to_le16(val));
df5da47fe722e3 Hoan Tran 2017-04-24 135
df5da47fe722e3 Hoan Tran 2017-04-24 136 return ret;
df5da47fe722e3 Hoan Tran 2017-04-24 137 }
df5da47fe722e3 Hoan Tran 2017-04-24 138
f6505fbabc426b Feng Kan 2015-04-24 139 static void slimpro_i2c_rx_cb(struct mbox_client *cl, void *mssg)
f6505fbabc426b Feng Kan 2015-04-24 140 {
f6505fbabc426b Feng Kan 2015-04-24 141 struct slimpro_i2c_dev *ctx = to_slimpro_i2c_dev(cl);
f6505fbabc426b Feng Kan 2015-04-24 142
f6505fbabc426b Feng Kan 2015-04-24 143 /*
f6505fbabc426b Feng Kan 2015-04-24 144 * Response message format:
f6505fbabc426b Feng Kan 2015-04-24 145 * mssg[0] is the return code of the operation
f6505fbabc426b Feng Kan 2015-04-24 146 * mssg[1] is the first data word
f6505fbabc426b Feng Kan 2015-04-24 147 * mssg[2] is NOT used
f6505fbabc426b Feng Kan 2015-04-24 148 */
f6505fbabc426b Feng Kan 2015-04-24 149 if (ctx->resp_msg)
f6505fbabc426b Feng Kan 2015-04-24 150 *ctx->resp_msg = ((u32 *)mssg)[1];
f6505fbabc426b Feng Kan 2015-04-24 151
f6505fbabc426b Feng Kan 2015-04-24 152 if (ctx->mbox_client.tx_block)
f6505fbabc426b Feng Kan 2015-04-24 153 complete(&ctx->rd_complete);
f6505fbabc426b Feng Kan 2015-04-24 154 }
f6505fbabc426b Feng Kan 2015-04-24 155
df5da47fe722e3 Hoan Tran 2017-04-24 156 static void slimpro_i2c_pcc_rx_cb(struct mbox_client *cl, void *msg)
df5da47fe722e3 Hoan Tran 2017-04-24 157 {
df5da47fe722e3 Hoan Tran 2017-04-24 158 struct slimpro_i2c_dev *ctx = to_slimpro_i2c_dev(cl);
df5da47fe722e3 Hoan Tran 2017-04-24 159 struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr;
df5da47fe722e3 Hoan Tran 2017-04-24 160
df5da47fe722e3 Hoan Tran 2017-04-24 161 /* Check if platform sends interrupt */
df5da47fe722e3 Hoan Tran 2017-04-24 162 if (!xgene_word_tst_and_clr(&generic_comm_base->status,
df5da47fe722e3 Hoan Tran 2017-04-24 163 PCC_STS_SCI_DOORBELL))
df5da47fe722e3 Hoan Tran 2017-04-24 164 return;
df5da47fe722e3 Hoan Tran 2017-04-24 165
df5da47fe722e3 Hoan Tran 2017-04-24 166 if (xgene_word_tst_and_clr(&generic_comm_base->status,
df5da47fe722e3 Hoan Tran 2017-04-24 167 PCC_STS_CMD_COMPLETE)) {
df5da47fe722e3 Hoan Tran 2017-04-24 168 msg = generic_comm_base + 1;
df5da47fe722e3 Hoan Tran 2017-04-24 169
df5da47fe722e3 Hoan Tran 2017-04-24 170 /* Response message msg[1] contains the return value. */
df5da47fe722e3 Hoan Tran 2017-04-24 171 if (ctx->resp_msg)
df5da47fe722e3 Hoan Tran 2017-04-24 172 *ctx->resp_msg = ((u32 *)msg)[1];
df5da47fe722e3 Hoan Tran 2017-04-24 173
df5da47fe722e3 Hoan Tran 2017-04-24 174 complete(&ctx->rd_complete);
df5da47fe722e3 Hoan Tran 2017-04-24 175 }
df5da47fe722e3 Hoan Tran 2017-04-24 176 }
df5da47fe722e3 Hoan Tran 2017-04-24 177
df5da47fe722e3 Hoan Tran 2017-04-24 178 static void slimpro_i2c_pcc_tx_prepare(struct slimpro_i2c_dev *ctx, u32 *msg)
df5da47fe722e3 Hoan Tran 2017-04-24 179 {
df5da47fe722e3 Hoan Tran 2017-04-24 180 struct acpi_pcct_shared_memory *generic_comm_base = ctx->pcc_comm_addr;
df5da47fe722e3 Hoan Tran 2017-04-24 181 u32 *ptr = (void *)(generic_comm_base + 1);
df5da47fe722e3 Hoan Tran 2017-04-24 182 u16 status;
df5da47fe722e3 Hoan Tran 2017-04-24 183 int i;
df5da47fe722e3 Hoan Tran 2017-04-24 184
df5da47fe722e3 Hoan Tran 2017-04-24 @185 WRITE_ONCE(generic_comm_base->signature,
df5da47fe722e3 Hoan Tran 2017-04-24 186 cpu_to_le32(PCC_SIGNATURE | ctx->mbox_idx));
df5da47fe722e3 Hoan Tran 2017-04-24 187
df5da47fe722e3 Hoan Tran 2017-04-24 188 WRITE_ONCE(generic_comm_base->command,
df5da47fe722e3 Hoan Tran 2017-04-24 189 cpu_to_le16(SLIMPRO_MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INT));
df5da47fe722e3 Hoan Tran 2017-04-24 190
df5da47fe722e3 Hoan Tran 2017-04-24 191 status = le16_to_cpu(READ_ONCE(generic_comm_base->status));
df5da47fe722e3 Hoan Tran 2017-04-24 192 status &= ~PCC_STS_CMD_COMPLETE;
df5da47fe722e3 Hoan Tran 2017-04-24 193 WRITE_ONCE(generic_comm_base->status, cpu_to_le16(status));
df5da47fe722e3 Hoan Tran 2017-04-24 194
df5da47fe722e3 Hoan Tran 2017-04-24 195 /* Copy the message to the PCC comm space */
df5da47fe722e3 Hoan Tran 2017-04-24 196 for (i = 0; i < SLIMPRO_IIC_MSG_DWORD_COUNT; i++)
df5da47fe722e3 Hoan Tran 2017-04-24 197 WRITE_ONCE(ptr[i], cpu_to_le32(msg[i]));
df5da47fe722e3 Hoan Tran 2017-04-24 198 }
df5da47fe722e3 Hoan Tran 2017-04-24 199
:::::: The code at line 134 was first introduced by commit
:::::: df5da47fe722e36055b97134e6bb9df58c12495c i2c: xgene-slimpro: Add ACPI support by using PCC mailbox
:::::: TO: Hoan Tran <hotran(a)apm.com>
:::::: CC: Wolfram Sang <wsa(a)the-dreams.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
drivers/staging/wfx/hif_tx.c:53:2-8: preceding lock on line 38 (fwd)
by Julia Lawall
Hello,
Please check whether there should be an unlock before line 53.
julia
---------- Forwarded message ----------
Date: Fri, 10 Jul 2020 19:00:10 +0800
From: kernel test robot <lkp(a)intel.com>
To: kbuild(a)lists.01.org
Cc: lkp(a)intel.com, Julia Lawall <julia.lawall(a)lip6.fr>
Subject: drivers/staging/wfx/hif_tx.c:53:2-8: preceding lock on line 38
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: "Jérôme Pouiller" <jerome.pouiller(a)silabs.com>
CC: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42f82040ee66db13525dc6f14b8559890b2f4c1c
commit: 4f8b7fabb15df3658564a98971fc67029be1815d staging: wfx: allow to send commands to chip
date: 9 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 9 months ago
config: openrisc-randconfig-c022-20200710 (attached as .config)
compiler: or1k-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>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/staging/wfx/hif_tx.c:53:2-8: preceding lock on line 38
# 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 remote update linus
git checkout 4f8b7fabb15df3658564a98971fc67029be1815d
vim +53 drivers/staging/wfx/hif_tx.c
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 23
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 24 int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request, void *reply, size_t reply_len, bool async)
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 25 {
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 26 const char *mib_name = "";
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 27 const char *mib_sep = "";
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 28 int cmd = request->id;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 29 int vif = request->interface;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 30 int ret;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 31
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 32 WARN(wdev->hif_cmd.buf_recv && wdev->hif_cmd.async, "API usage error");
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 33
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 34 // Do not wait for any reply if chip is frozen
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 35 if (wdev->chip_frozen)
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 36 return -ETIMEDOUT;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 37
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 @38 mutex_lock(&wdev->hif_cmd.lock);
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 39 WARN(wdev->hif_cmd.buf_send, "data locking error");
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 40
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 41 // Note: call to complete() below has an implicit memory barrier that
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 42 // hopefully protect buf_send
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 43 wdev->hif_cmd.buf_send = request;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 44 wdev->hif_cmd.buf_recv = reply;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 45 wdev->hif_cmd.len_recv = reply_len;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 46 wdev->hif_cmd.async = async;
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 47 complete(&wdev->hif_cmd.ready);
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 48
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 49 wfx_bh_request_tx(wdev);
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 50
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 51 // NOTE: no timeout is catched async is enabled
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 52 if (async)
4f8b7fabb15df3 Jérôme Pouiller 2019-09-19 @53 return 0;
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
ERROR: "min_low_pfn" undefined!
by kernel test robot
Hi Jiasen,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 42f82040ee66db13525dc6f14b8559890b2f4c1c
commit: 99a06056124dcf5cfc4c95278b86c6ff96aaa1ec NTB: ntb_perf: Fix address err in perf_copy_chunk
date: 4 months ago
config: microblaze-randconfig-r011-20200710 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 99a06056124dcf5cfc4c95278b86c6ff96aaa1ec
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
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 >>):
ERROR: "min_low_pfn" [drivers/ntb/ntb_transport.ko] undefined!
>> ERROR: "min_low_pfn" [drivers/ntb/test/ntb_perf.ko] undefined!
ERROR: "min_low_pfn" [drivers/rpmsg/virtio_rpmsg_bus.ko] undefined!
ERROR: "min_low_pfn" [drivers/hwtracing/intel_th/intel_th_msu_sink.ko] undefined!
ERROR: "min_low_pfn" [drivers/hwtracing/intel_th/intel_th_msu.ko] undefined!
ERROR: "min_low_pfn" [drivers/mmc/core/mmc_core.ko] undefined!
ERROR: "min_low_pfn" [crypto/tcrypt.ko] undefined!
ERROR: "min_low_pfn" [crypto/ccm.ko] undefined!
ERROR: "min_low_pfn" [crypto/gcm.ko] undefined!
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[vincent.guittot:sched/pelt 1/2] kernel/sched/fair.c:4056:25: warning: comparison of distinct pointer types ('typeof (task_h_load(p)) (aka 'unsigned long and 'typeof (1) (aka 'int
by kernel test robot
tree: https://git.linaro.org/people/vincent.guittot/kernel.git sched/pelt
head: cc807c0b8d03785da906a6a8436be5838bfe9d54
commit: a057128bc3087ebc9505454a1b5d7a4ae35c6e04 [1/2] sched/fair: handle case of task_h_load() returning 0
config: s390-randconfig-r031-20200710 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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 s390 cross compiling tool for clang build
# apt-get install binutils-s390x-linux-gnu
git checkout a057128bc3087ebc9505454a1b5d7a4ae35c6e04
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=s390
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 >>):
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:20:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
^
In file included from kernel/sched/fair.c:23:
In file included from kernel/sched/sched.h:17:
In file included from include/linux/sched/isolation.h:6:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:21:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
^
In file included from kernel/sched/fair.c:23:
In file included from kernel/sched/sched.h:17:
In file included from include/linux/sched/isolation.h:6:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:119:21: note: expanded from macro '__swab32'
___constant_swab32(x) : \
^
include/uapi/linux/swab.h:22:12: note: expanded from macro '___constant_swab32'
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))
^
In file included from kernel/sched/fair.c:23:
In file included from kernel/sched/sched.h:17:
In file included from include/linux/sched/isolation.h:6:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:490:45: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:34:59: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
^
include/uapi/linux/swab.h:120:12: note: expanded from macro '__swab32'
__fswab32(x))
^
In file included from kernel/sched/fair.c:23:
In file included from kernel/sched/sched.h:17:
In file included from include/linux/sched/isolation.h:6:
In file included from include/linux/tick.h:8:
In file included from include/linux/clockchips.h:14:
In file included from include/linux/clocksource.h:21:
In file included from arch/s390/include/asm/io.h:72:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew(cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:46: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel(cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:609:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:617:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:625:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
readsl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:634:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesb(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:643:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesw(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
include/asm-generic/io.h:652:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
writesl(PCI_IOBASE + addr, buffer, count);
~~~~~~~~~~ ^
>> kernel/sched/fair.c:4056:25: warning: comparison of distinct pointer types ('typeof (task_h_load(p)) *' (aka 'unsigned long *') and 'typeof (1) *' (aka 'int *')) [-Wcompare-distinct-pointer-types]
rq->misfit_task_load = max(task_h_load(p), 1);
^~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:891:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(x, y, >)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:875:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:865:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/kernel.h:851:29: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
kernel/sched/fair.c:7662:11: warning: comparison of distinct pointer types ('typeof (task_h_load(p)) *' (aka 'unsigned long *') and 'typeof (1) *' (aka 'int *')) [-Wcompare-distinct-pointer-types]
load = max(task_h_load(p), 1);
^~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:891:19: note: expanded from macro 'max'
#define max(x, y) __careful_cmp(x, y, >)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:875:24: note: expanded from macro '__careful_cmp'
__builtin_choose_expr(__safe_cmp(x, y), \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:865:4: note: expanded from macro '__safe_cmp'
(__typecheck(x, y) && __no_side_effects(x, y))
^~~~~~~~~~~~~~~~~
include/linux/kernel.h:851:29: note: expanded from macro '__typecheck'
(!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
kernel/sched/fair.c:8180:19: warning: unused function 'check_misfit_status' [-Wunused-function]
static inline int check_misfit_status(struct rq *rq, struct sched_domain *sd)
^
23 warnings generated.
vim +4056 kernel/sched/fair.c
4036
4037 static inline void update_misfit_status(struct task_struct *p, struct rq *rq)
4038 {
4039 if (!static_branch_unlikely(&sched_asym_cpucapacity))
4040 return;
4041
4042 if (!p) {
4043 rq->misfit_task_load = 0;
4044 return;
4045 }
4046
4047 if (task_fits_capacity(p, capacity_of(cpu_of(rq)))) {
4048 rq->misfit_task_load = 0;
4049 return;
4050 }
4051
4052 /*
4053 * Make sure that misfit_task_load will not be null even if
4054 * task_h_load() returns 0.
4055 */
> 4056 rq->misfit_task_load = max(task_h_load(p), 1);
4057 }
4058
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[vincent.guittot:sched/pelt 1/2] include/linux/kernel.h:851:29: warning: comparison of distinct pointer types lacks a cast
by kernel test robot
tree: https://git.linaro.org/people/vincent.guittot/kernel.git sched/pelt
head: cc807c0b8d03785da906a6a8436be5838bfe9d54
commit: a057128bc3087ebc9505454a1b5d7a4ae35c6e04 [1/2] sched/fair: handle case of task_h_load() returning 0
config: ia64-randconfig-r035-20200710 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout a057128bc3087ebc9505454a1b5d7a4ae35c6e04
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.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 >>):
In file included from include/linux/list.h:9,
from include/linux/rculist.h:10,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from kernel/sched/sched.h:5,
from kernel/sched/fair.c:23:
kernel/sched/fair.c: In function 'update_misfit_status':
>> include/linux/kernel.h:851:29: warning: comparison of distinct pointer types lacks a cast
851 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/linux/kernel.h:865:4: note: in expansion of macro '__typecheck'
865 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
include/linux/kernel.h:875:24: note: in expansion of macro '__safe_cmp'
875 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/kernel.h:891:19: note: in expansion of macro '__careful_cmp'
891 | #define max(x, y) __careful_cmp(x, y, >)
| ^~~~~~~~~~~~~
kernel/sched/fair.c:4056:25: note: in expansion of macro 'max'
4056 | rq->misfit_task_load = max(task_h_load(p), 1);
| ^~~
kernel/sched/fair.c: In function 'detach_tasks':
>> include/linux/kernel.h:851:29: warning: comparison of distinct pointer types lacks a cast
851 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
| ^~
include/linux/kernel.h:865:4: note: in expansion of macro '__typecheck'
865 | (__typecheck(x, y) && __no_side_effects(x, y))
| ^~~~~~~~~~~
include/linux/kernel.h:875:24: note: in expansion of macro '__safe_cmp'
875 | __builtin_choose_expr(__safe_cmp(x, y), \
| ^~~~~~~~~~
include/linux/kernel.h:891:19: note: in expansion of macro '__careful_cmp'
891 | #define max(x, y) __careful_cmp(x, y, >)
| ^~~~~~~~~~~~~
kernel/sched/fair.c:7662:11: note: in expansion of macro 'max'
7662 | load = max(task_h_load(p), 1);
| ^~~
vim +851 include/linux/kernel.h
526211bc58c4b32 Ingo Molnar 2009-03-05 837
^1da177e4c3f415 Linus Torvalds 2005-04-16 838 /*
3c8ba0d61d04ced Kees Cook 2018-03-30 839 * min()/max()/clamp() macros must accomplish three things:
3c8ba0d61d04ced Kees Cook 2018-03-30 840 *
3c8ba0d61d04ced Kees Cook 2018-03-30 841 * - avoid multiple evaluations of the arguments (so side-effects like
3c8ba0d61d04ced Kees Cook 2018-03-30 842 * "x++" happen only once) when non-constant.
3c8ba0d61d04ced Kees Cook 2018-03-30 843 * - perform strict type-checking (to generate warnings instead of
3c8ba0d61d04ced Kees Cook 2018-03-30 844 * nasty runtime surprises). See the "unnecessary" pointer comparison
3c8ba0d61d04ced Kees Cook 2018-03-30 845 * in __typecheck().
3c8ba0d61d04ced Kees Cook 2018-03-30 846 * - retain result as a constant expressions when called with only
3c8ba0d61d04ced Kees Cook 2018-03-30 847 * constant expressions (to avoid tripping VLA warnings in stack
3c8ba0d61d04ced Kees Cook 2018-03-30 848 * allocation usage).
3c8ba0d61d04ced Kees Cook 2018-03-30 849 */
3c8ba0d61d04ced Kees Cook 2018-03-30 850 #define __typecheck(x, y) \
3c8ba0d61d04ced Kees Cook 2018-03-30 @851 (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
3c8ba0d61d04ced Kees Cook 2018-03-30 852
:::::: The code at line 851 was first introduced by commit
:::::: 3c8ba0d61d04ced9f8d9ff93977995a9e4e96e91 kernel.h: Retain constant expression output for max()/min()
:::::: TO: Kees Cook <keescook(a)chromium.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months