drivers/regulator/max20086-regulator.c:288:34: error: 'max20086_dt_ids' defined but not used
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 754e0b0e35608ed5206d6a67a791563c631cec07
commit: bfff546aae50ae68ed395bf0e0848188d27b0ba3 regulator: Add MAX20086-MAX20089 driver
date: 5 weeks ago
config: xtensa-randconfig-c004-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142332.ciTQ7uCd-lk...)
compiler: xtensa-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 bfff546aae50ae68ed395bf0e0848188d27b0ba3
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=xtensa SHELL=/bin/bash arch/xtensa/ drivers/
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 >>):
>> drivers/regulator/max20086-regulator.c:288:34: error: 'max20086_dt_ids' defined but not used [-Werror=unused-const-variable=]
288 | static const struct of_device_id max20086_dt_ids[] = {
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/max20086_dt_ids +288 drivers/regulator/max20086-regulator.c
287
> 288 static const struct of_device_id max20086_dt_ids[] = {
289 {
290 .compatible = "maxim,max20086",
291 .data = &(const struct max20086_chip_info) {
292 .id = MAX20086_DEVICE_ID_MAX20086,
293 .num_outputs = 4,
294 }
295 }, {
296 .compatible = "maxim,max20087",
297 .data = &(const struct max20086_chip_info) {
298 .id = MAX20086_DEVICE_ID_MAX20087,
299 .num_outputs = 4,
300 }
301 }, {
302 .compatible = "maxim,max20088",
303 .data = &(const struct max20086_chip_info) {
304 .id = MAX20086_DEVICE_ID_MAX20088,
305 .num_outputs = 2,
306 }
307 }, {
308 .compatible = "maxim,max20089",
309 .data = &(const struct max20086_chip_info) {
310 .id = MAX20086_DEVICE_ID_MAX20089,
311 .num_outputs = 2,
312 }
313 },
314 { /* Sentinel */ },
315 };
316
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH v6 7/7] kernfs: Replace per-fs rwsem with hashed ones.
by kernel test robot
Hi Imran,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on 6d9bd4ad4ca08b1114e814c2c42383b8b13be631]
url: https://github.com/0day-ci/linux/commits/Imran-Khan/kernfs-Introduce-hash...
base: 6d9bd4ad4ca08b1114e814c2c42383b8b13be631
config: hexagon-randconfig-r012-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142322.OezS0EtW-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project ea071884b0cc7210b3cc5fe858f0e892a779a23b)
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/0day-ci/linux/commit/48eab913f80f1555d57b964ef7cdba17f...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Imran-Khan/kernfs-Introduce-hashed-mutexes-to-replace-global-kernfs_open_file_mutex/20220214-200700
git checkout 48eab913f80f1555d57b964ef7cdba17f5ec5d1f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/kernfs/
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/kernfs/dir.c:1619:7: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!new_name)
^~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1619:3: note: remove the 'if' if its condition is always false
if (!new_name)
^~~~~~~~~~~~~~
fs/kernfs/dir.c:1612:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (kernfs_find_ns(new_parent, new_name, new_ns))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1612:2: note: remove the 'if' if its condition is always false
if (kernfs_find_ns(new_parent, new_name, new_ns))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1607:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1607:2: note: remove the 'if' if its condition is always false
if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1602:2: note: remove the 'if' if its condition is always false
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1602:6: note: remove the '||' if its condition is always false
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/kernfs/dir.c:1602:6: warning: variable 'old_parent' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1653:50: note: uninitialized use occurs here
up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
^~~~~~~~~~
fs/kernfs/dir.c:1602:6: note: remove the '||' if its condition is always false
if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
^~~~~~~~~~~~~~~~~~~~~
fs/kernfs/dir.c:1591:32: note: initialize the variable 'old_parent' to silence this warning
struct kernfs_node *old_parent;
^
= NULL
6 warnings generated.
vim +1619 fs/kernfs/dir.c
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1580
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1581 /**
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1582 * kernfs_rename_ns - move and rename a kernfs_node
324a56e16e44ba Tejun Heo 2013-12-11 1583 * @kn: target node
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1584 * @new_parent: new parent to put @sd under
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1585 * @new_name: new name
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1586 * @new_ns: new namespace tag
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1587 */
324a56e16e44ba Tejun Heo 2013-12-11 1588 int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1589 const char *new_name, const void *new_ns)
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1590 {
3eef34ad7dc369 Tejun Heo 2014-02-07 1591 struct kernfs_node *old_parent;
3eef34ad7dc369 Tejun Heo 2014-02-07 1592 const char *old_name = NULL;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1593 int error;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1594
3eef34ad7dc369 Tejun Heo 2014-02-07 1595 /* can't move or rename root */
3eef34ad7dc369 Tejun Heo 2014-02-07 1596 if (!kn->parent)
3eef34ad7dc369 Tejun Heo 2014-02-07 1597 return -EINVAL;
3eef34ad7dc369 Tejun Heo 2014-02-07 1598
48eab913f80f15 Imran Khan 2022-02-14 1599 down_write_kernfs_rwsem_rename_ns(kn, kn->parent, new_parent);
798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1600
d0ae3d4347ee02 Tejun Heo 2013-12-11 1601 error = -ENOENT;
ea015218f2f7ac Eric W. Biederman 2015-05-13 @1602 if (!kernfs_active(kn) || !kernfs_active(new_parent) ||
ea015218f2f7ac Eric W. Biederman 2015-05-13 1603 (new_parent->flags & KERNFS_EMPTY_DIR))
d0ae3d4347ee02 Tejun Heo 2013-12-11 1604 goto out;
d0ae3d4347ee02 Tejun Heo 2013-12-11 1605
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1606 error = 0;
adc5e8b58f4886 Tejun Heo 2013-12-11 1607 if ((kn->parent == new_parent) && (kn->ns == new_ns) &&
adc5e8b58f4886 Tejun Heo 2013-12-11 1608 (strcmp(kn->name, new_name) == 0))
798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1609 goto out; /* nothing to rename */
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1610
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1611 error = -EEXIST;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1612 if (kernfs_find_ns(new_parent, new_name, new_ns))
798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1613 goto out;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1614
324a56e16e44ba Tejun Heo 2013-12-11 1615 /* rename kernfs_node */
adc5e8b58f4886 Tejun Heo 2013-12-11 1616 if (strcmp(kn->name, new_name) != 0) {
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1617 error = -ENOMEM;
75287a677ba1be Andrzej Hajda 2015-02-13 1618 new_name = kstrdup_const(new_name, GFP_KERNEL);
fd7b9f7b9776b1 Tejun Heo 2013-11-28 @1619 if (!new_name)
798c75a0d44cdb Greg Kroah-Hartman 2014-01-13 1620 goto out;
3eef34ad7dc369 Tejun Heo 2014-02-07 1621 } else {
3eef34ad7dc369 Tejun Heo 2014-02-07 1622 new_name = NULL;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1623 }
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1624
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1625 /*
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1626 * Move to the appropriate place in the appropriate directories rbtree.
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1627 */
c637b8acbe079e Tejun Heo 2013-12-11 1628 kernfs_unlink_sibling(kn);
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1629 kernfs_get(new_parent);
3eef34ad7dc369 Tejun Heo 2014-02-07 1630
3eef34ad7dc369 Tejun Heo 2014-02-07 1631 /* rename_lock protects ->parent and ->name accessors */
3eef34ad7dc369 Tejun Heo 2014-02-07 1632 spin_lock_irq(&kernfs_rename_lock);
3eef34ad7dc369 Tejun Heo 2014-02-07 1633
3eef34ad7dc369 Tejun Heo 2014-02-07 1634 old_parent = kn->parent;
adc5e8b58f4886 Tejun Heo 2013-12-11 1635 kn->parent = new_parent;
3eef34ad7dc369 Tejun Heo 2014-02-07 1636
3eef34ad7dc369 Tejun Heo 2014-02-07 1637 kn->ns = new_ns;
3eef34ad7dc369 Tejun Heo 2014-02-07 1638 if (new_name) {
3eef34ad7dc369 Tejun Heo 2014-02-07 1639 old_name = kn->name;
3eef34ad7dc369 Tejun Heo 2014-02-07 1640 kn->name = new_name;
3eef34ad7dc369 Tejun Heo 2014-02-07 1641 }
3eef34ad7dc369 Tejun Heo 2014-02-07 1642
3eef34ad7dc369 Tejun Heo 2014-02-07 1643 spin_unlock_irq(&kernfs_rename_lock);
3eef34ad7dc369 Tejun Heo 2014-02-07 1644
9561a8961c708f Tejun Heo 2014-02-10 1645 kn->hash = kernfs_name_hash(kn->name, kn->ns);
c637b8acbe079e Tejun Heo 2013-12-11 1646 kernfs_link_sibling(kn);
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1647
3eef34ad7dc369 Tejun Heo 2014-02-07 1648 kernfs_put(old_parent);
75287a677ba1be Andrzej Hajda 2015-02-13 1649 kfree_const(old_name);
3eef34ad7dc369 Tejun Heo 2014-02-07 1650
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1651 error = 0;
ae34372eb8408b Tejun Heo 2014-01-10 1652 out:
48eab913f80f15 Imran Khan 2022-02-14 1653 up_write_kernfs_rwsem_rename_ns(kn, new_parent, old_parent);
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1654 return error;
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1655 }
fd7b9f7b9776b1 Tejun Heo 2013-11-28 1656
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[ammarfaizi2-block:rostedt/linux-trace/ftrace/core 12/13] include/linux/fortify-string.h:47:30: error: '__builtin_strncat' output truncated before terminating nul copying as many bytes from a string as its length
by kernel test robot
tree: https://github.com/ammarfaizi2/linux-block rostedt/linux-trace/ftrace/core
head: f125ef075cd648a7794aa0cc61a188b1c40c8f94
commit: a76d8704e28d6591e72ab79fd2807254bd79327e [12/13] tracing: Remove size restriction on hist trigger cmd error logging
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220214/202202140628.fj6e4w4v-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/ammarfaizi2/linux-block/commit/a76d8704e28d6591e72ab79...
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block rostedt/linux-trace/ftrace/core
git checkout a76d8704e28d6591e72ab79fd2807254bd79327e
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
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 >>):
In file included from include/linux/string.h:253,
from arch/x86/include/asm/page_32.h:22,
from arch/x86/include/asm/page.h:14,
from arch/x86/include/asm/processor.h:19,
from arch/x86/include/asm/timex.h:5,
from include/linux/timex.h:65,
from include/linux/time32.h:13,
from include/linux/time.h:60,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from kernel/trace/trace_events_hist.c:8:
In function 'strncat',
inlined from 'last_cmd_set' at kernel/trace/trace_events_hist.c:759:2:
>> include/linux/fortify-string.h:47:30: error: '__builtin_strncat' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
47 | #define __underlying_strncat __builtin_strncat
| ^
include/linux/fortify-string.h:191:10: note: in expansion of macro '__underlying_strncat'
191 | return __underlying_strncat(p, q, count);
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/trace_events_hist.c: In function 'last_cmd_set':
include/linux/fortify-string.h:46:29: note: length computed here
46 | #define __underlying_strlen __builtin_strlen
| ^
include/linux/fortify-string.h:102:10: note: in expansion of macro '__underlying_strlen'
102 | return __underlying_strlen(p);
| ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/__builtin_strncat +47 include/linux/fortify-string.h
3009f891bb9f32 Kees Cook 2021-08-02 26
a28a6e860c6cf2 Francis Laniel 2021-02-25 27 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
a28a6e860c6cf2 Francis Laniel 2021-02-25 28 extern void *__underlying_memchr(const void *p, int c, __kernel_size_t size) __RENAME(memchr);
a28a6e860c6cf2 Francis Laniel 2021-02-25 29 extern int __underlying_memcmp(const void *p, const void *q, __kernel_size_t size) __RENAME(memcmp);
a28a6e860c6cf2 Francis Laniel 2021-02-25 30 extern void *__underlying_memcpy(void *p, const void *q, __kernel_size_t size) __RENAME(memcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 31 extern void *__underlying_memmove(void *p, const void *q, __kernel_size_t size) __RENAME(memmove);
a28a6e860c6cf2 Francis Laniel 2021-02-25 32 extern void *__underlying_memset(void *p, int c, __kernel_size_t size) __RENAME(memset);
a28a6e860c6cf2 Francis Laniel 2021-02-25 33 extern char *__underlying_strcat(char *p, const char *q) __RENAME(strcat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 34 extern char *__underlying_strcpy(char *p, const char *q) __RENAME(strcpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 35 extern __kernel_size_t __underlying_strlen(const char *p) __RENAME(strlen);
a28a6e860c6cf2 Francis Laniel 2021-02-25 36 extern char *__underlying_strncat(char *p, const char *q, __kernel_size_t count) __RENAME(strncat);
a28a6e860c6cf2 Francis Laniel 2021-02-25 37 extern char *__underlying_strncpy(char *p, const char *q, __kernel_size_t size) __RENAME(strncpy);
a28a6e860c6cf2 Francis Laniel 2021-02-25 38 #else
a28a6e860c6cf2 Francis Laniel 2021-02-25 39 #define __underlying_memchr __builtin_memchr
a28a6e860c6cf2 Francis Laniel 2021-02-25 40 #define __underlying_memcmp __builtin_memcmp
a28a6e860c6cf2 Francis Laniel 2021-02-25 41 #define __underlying_memcpy __builtin_memcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 42 #define __underlying_memmove __builtin_memmove
a28a6e860c6cf2 Francis Laniel 2021-02-25 43 #define __underlying_memset __builtin_memset
a28a6e860c6cf2 Francis Laniel 2021-02-25 44 #define __underlying_strcat __builtin_strcat
a28a6e860c6cf2 Francis Laniel 2021-02-25 45 #define __underlying_strcpy __builtin_strcpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 46 #define __underlying_strlen __builtin_strlen
a28a6e860c6cf2 Francis Laniel 2021-02-25 @47 #define __underlying_strncat __builtin_strncat
a28a6e860c6cf2 Francis Laniel 2021-02-25 48 #define __underlying_strncpy __builtin_strncpy
a28a6e860c6cf2 Francis Laniel 2021-02-25 49 #endif
a28a6e860c6cf2 Francis Laniel 2021-02-25 50
:::::: The code at line 47 was first introduced by commit
:::::: a28a6e860c6cf231cf3c5171c75c342adcd00406 string.h: move fortified functions definitions in a dedicated header.
:::::: TO: Francis Laniel <laniel_francis(a)privacyrequired.com>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[willy-pagecache:for-next 52/85] mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)'
by kernel test robot
tree: git://git.infradead.org/users/willy/pagecache for-next
head: c267b33d0001488f1d9dad12d6a87655e174d914
commit: 9733dd1f11d6b6f8a38fa82f0cc014f7840cbd67 [52/85] mm: Convert page_vma_mapped_walk to work on PFNs
config: xtensa-randconfig-m031-20220213 (https://download.01.org/0day-ci/archive/20220214/202202141933.YLNzdo4f-lk...)
compiler: xtensa-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
smatch warnings:
mm/page_vma_mapped.c:246 page_vma_mapped_walk() warn: always true condition '(pvmw->nr_pages >= (1 << ( - 12))) => (0-u32max >= 0)'
vim +246 mm/page_vma_mapped.c
126
127 /**
128 * page_vma_mapped_walk - check if @pvmw->pfn is mapped in @pvmw->vma at
129 * @pvmw->address
130 * @pvmw: pointer to struct page_vma_mapped_walk. page, vma, address and flags
131 * must be set. pmd, pte and ptl must be NULL.
132 *
133 * Returns true if the page is mapped in the vma. @pvmw->pmd and @pvmw->pte point
134 * to relevant page table entries. @pvmw->ptl is locked. @pvmw->address is
135 * adjusted if needed (for PTE-mapped THPs).
136 *
137 * If @pvmw->pmd is set but @pvmw->pte is not, you have found PMD-mapped page
138 * (usually THP). For PTE-mapped THP, you should run page_vma_mapped_walk() in
139 * a loop to find all PTEs that map the THP.
140 *
141 * For HugeTLB pages, @pvmw->pte is set to the relevant page table entry
142 * regardless of which page table level the page is mapped at. @pvmw->pmd is
143 * NULL.
144 *
145 * Returns false if there are no more page table entries for the page in
146 * the vma. @pvmw->ptl is unlocked and @pvmw->pte is unmapped.
147 *
148 * If you need to stop the walk before page_vma_mapped_walk() returned false,
149 * use page_vma_mapped_walk_done(). It will do the housekeeping.
150 */
151 bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw)
152 {
153 struct vm_area_struct *vma = pvmw->vma;
154 struct mm_struct *mm = vma->vm_mm;
155 unsigned long end;
156 pgd_t *pgd;
157 p4d_t *p4d;
158 pud_t *pud;
159 pmd_t pmde;
160
161 /* The only possible pmd mapping has been handled on last iteration */
162 if (pvmw->pmd && !pvmw->pte)
163 return not_found(pvmw);
164
165 if (unlikely(is_vm_hugetlb_page(vma))) {
166 unsigned long size = pvmw->nr_pages * PAGE_SIZE;
167 /* The only possible mapping was handled on last iteration */
168 if (pvmw->pte)
169 return not_found(pvmw);
170
171 /* when pud is not present, pte will be NULL */
172 pvmw->pte = huge_pte_offset(mm, pvmw->address, size);
173 if (!pvmw->pte)
174 return false;
175
176 pvmw->ptl = huge_pte_lockptr(size_to_hstate(size), mm,
177 pvmw->pte);
178 spin_lock(pvmw->ptl);
179 if (!check_pte(pvmw))
180 return not_found(pvmw);
181 return true;
182 }
183
184 end = vma_address_end(pvmw);
185 if (pvmw->pte)
186 goto next_pte;
187 restart:
188 do {
189 pgd = pgd_offset(mm, pvmw->address);
190 if (!pgd_present(*pgd)) {
191 step_forward(pvmw, PGDIR_SIZE);
192 continue;
193 }
194 p4d = p4d_offset(pgd, pvmw->address);
195 if (!p4d_present(*p4d)) {
196 step_forward(pvmw, P4D_SIZE);
197 continue;
198 }
199 pud = pud_offset(p4d, pvmw->address);
200 if (!pud_present(*pud)) {
201 step_forward(pvmw, PUD_SIZE);
202 continue;
203 }
204
205 pvmw->pmd = pmd_offset(pud, pvmw->address);
206 /*
207 * Make sure the pmd value isn't cached in a register by the
208 * compiler and used as a stale value after we've observed a
209 * subsequent update.
210 */
211 pmde = READ_ONCE(*pvmw->pmd);
212
213 if (pmd_trans_huge(pmde) || is_pmd_migration_entry(pmde)) {
214 pvmw->ptl = pmd_lock(mm, pvmw->pmd);
215 pmde = *pvmw->pmd;
216 if (likely(pmd_trans_huge(pmde))) {
217 if (pvmw->flags & PVMW_MIGRATION)
218 return not_found(pvmw);
219 if (!check_pmd(pmd_pfn(pmde), pvmw))
220 return not_found(pvmw);
221 return true;
222 }
223 if (!pmd_present(pmde)) {
224 swp_entry_t entry;
225
226 if (!thp_migration_supported() ||
227 !(pvmw->flags & PVMW_MIGRATION))
228 return not_found(pvmw);
229 entry = pmd_to_swp_entry(pmde);
230 if (!is_migration_entry(entry) ||
231 !check_pmd(swp_offset(entry), pvmw))
232 return not_found(pvmw);
233 return true;
234 }
235 /* THP pmd was split under us: handle on pte level */
236 spin_unlock(pvmw->ptl);
237 pvmw->ptl = NULL;
238 } else if (!pmd_present(pmde)) {
239 /*
240 * If PVMW_SYNC, take and drop THP pmd lock so that we
241 * cannot return prematurely, while zap_huge_pmd() has
242 * cleared *pmd but not decremented compound_mapcount().
243 */
244 if ((pvmw->flags & PVMW_SYNC) &&
245 transparent_hugepage_active(vma) &&
> 246 (pvmw->nr_pages >= HPAGE_PMD_NR)) {
247 spinlock_t *ptl = pmd_lock(mm, pvmw->pmd);
248
249 spin_unlock(ptl);
250 }
251 step_forward(pvmw, PMD_SIZE);
252 continue;
253 }
254 if (!map_pte(pvmw))
255 goto next_pte;
256 this_pte:
257 if (check_pte(pvmw))
258 return true;
259 next_pte:
260 do {
261 pvmw->address += PAGE_SIZE;
262 if (pvmw->address >= end)
263 return not_found(pvmw);
264 /* Did we cross page table boundary? */
265 if ((pvmw->address & (PMD_SIZE - PAGE_SIZE)) == 0) {
266 if (pvmw->ptl) {
267 spin_unlock(pvmw->ptl);
268 pvmw->ptl = NULL;
269 }
270 pte_unmap(pvmw->pte);
271 pvmw->pte = NULL;
272 goto restart;
273 }
274 pvmw->pte++;
275 if ((pvmw->flags & PVMW_SYNC) && !pvmw->ptl) {
276 pvmw->ptl = pte_lockptr(mm, pvmw->pmd);
277 spin_lock(pvmw->ptl);
278 }
279 } while (pte_none(*pvmw->pte));
280
281 if (!pvmw->ptl) {
282 pvmw->ptl = pte_lockptr(mm, pvmw->pmd);
283 spin_lock(pvmw->ptl);
284 }
285 goto this_pte;
286 } while (pvmw->address < end);
287
288 return false;
289 }
290
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[deller-parisc:for-next 5/6] arch/parisc/include/asm/bitops.h:20:2: error: #error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git for-next
head: dbd0b42350d5717786cb8257fbe5b528f3af9772
commit: b160628e9ebcdc85d0db9d7f423c26b3c7c179d0 [5/6] parisc: Show error if wrong 32/64-bit compiler is being used
config: parisc-randconfig-r004-20220213 (https://download.01.org/0day-ci/archive/20220214/202202142139.fHrrv9Oy-lk...)
compiler: hppa64-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/deller/parisc-linux.git/c...
git remote add deller-parisc https://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git
git fetch --no-tags deller-parisc for-next
git checkout b160628e9ebcdc85d0db9d7f423c26b3c7c179d0
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=parisc prepare
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 >>):
In file included from include/linux/bitops.h:33,
from include/linux/kernel.h:22,
from arch/parisc/include/asm/bug.h:5,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
>> arch/parisc/include/asm/bitops.h:20:2: error: #error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
20 | #error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
| ^~~~~
In file included from arch/parisc/include/asm/bitops.h:209,
from include/linux/bitops.h:33,
from include/linux/kernel.h:22,
from arch/parisc/include/asm/bug.h:5,
from include/linux/bug.h:5,
from include/linux/page-flags.h:10,
from kernel/bounds.c:10:
include/asm-generic/bitops/__fls.h: In function '__fls':
include/asm-generic/bitops/__fls.h:18:28: warning: left shift count >= width of type [-Wshift-count-overflow]
18 | if (!(word & (~0ul << 32))) {
| ^~
include/asm-generic/bitops/__fls.h:20:22: warning: left shift count >= width of type [-Wshift-count-overflow]
20 | word <<= 32;
| ^~~
include/asm-generic/bitops/__fls.h:23:28: warning: left shift count >= width of type [-Wshift-count-overflow]
23 | if (!(word & (~0ul << (BITS_PER_LONG-16)))) {
| ^~
include/asm-generic/bitops/__fls.h:27:28: warning: left shift count >= width of type [-Wshift-count-overflow]
27 | if (!(word & (~0ul << (BITS_PER_LONG-8)))) {
| ^~
include/asm-generic/bitops/__fls.h:31:28: warning: left shift count >= width of type [-Wshift-count-overflow]
31 | if (!(word & (~0ul << (BITS_PER_LONG-4)))) {
| ^~
include/asm-generic/bitops/__fls.h:35:28: warning: left shift count >= width of type [-Wshift-count-overflow]
35 | if (!(word & (~0ul << (BITS_PER_LONG-2)))) {
| ^~
include/asm-generic/bitops/__fls.h:39:28: warning: left shift count >= width of type [-Wshift-count-overflow]
39 | if (!(word & (~0ul << (BITS_PER_LONG-1))))
| ^~
make[2]: *** [scripts/Makefile.build:121: kernel/bounds.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1191: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +20 arch/parisc/include/asm/bitops.h
14
15 /* compiler build environment sanity checks: */
16 #if !defined(CONFIG_64BIT) && defined(__LP64__)
17 #error "Please use 'ARCH=parisc' to build the 32-bit kernel."
18 #endif
19 #if defined(CONFIG_64BIT) && !defined(__LP64__)
> 20 #error "Please use 'ARCH=parisc64' to build the 64-bit kernel."
21 #endif
22
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week