[mark:treewide/gnu99 1/1] include/asm-generic/fixmap.h:21:46: warning: left shift of negative value

From: kernel test robot
Date: Wed Jan 12 2022 - 17:29:49 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git treewide/gnu99
head: df0f3c59f076be0ab4a6d8de53fdeef871394594
commit: df0f3c59f076be0ab4a6d8de53fdeef871394594 [1/1] treewide: use -std=gnu99
config: um-i386_defconfig (https://download.01.org/0day-ci/archive/20220113/202201130624.MemBkw6f-lkp@xxxxxxxxx/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/mark/linux.git/commit/?id=df0f3c59f076be0ab4a6d8de53fdeef871394594
git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
git fetch --no-tags mark treewide/gnu99
git checkout df0f3c59f076be0ab4a6d8de53fdeef871394594
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=um SUBARCH=i386 SHELL=/bin/bash arch/um/kernel/ fs/isofs/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

In file included from arch/um/include/asm/fixmap.h:54,
from arch/um/include/asm/pgtable.h:11,
from include/linux/pgtable.h:6,
from include/linux/mm.h:33,
from include/linux/memblock.h:13,
from arch/um/kernel/mem.c:8:
arch/um/kernel/mem.c: In function 'paging_init':
>> include/asm-generic/fixmap.h:21:46: warning: left shift of negative value [-Wshift-negative-value]
21 | #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
| ^~
arch/um/kernel/mem.c:167:10: note: in expansion of macro '__fix_to_virt'
167 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;
| ^~~~~~~~~~~~~
arch/um/kernel/mem.c: At top level:
arch/um/kernel/mem.c:184:8: warning: no previous prototype for 'pgd_alloc' [-Wmissing-prototypes]
184 | pgd_t *pgd_alloc(struct mm_struct *mm)
| ^~~~~~~~~
arch/um/kernel/mem.c:197:7: warning: no previous prototype for 'uml_kmalloc' [-Wmissing-prototypes]
197 | void *uml_kmalloc(int size, int flags)
| ^~~~~~~~~~~
--
fs/isofs/util.c: In function 'iso_date':
>> fs/isofs/util.c:40:14: warning: left shift of negative value [-Wshift-negative-value]
40 | tz |= (-1 << 8);
| ^~


vim +21 include/asm-generic/fixmap.h

d57c33c5daa4ef Mark Salter 2014-01-23 20
d57c33c5daa4ef Mark Salter 2014-01-23 @21 #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
d57c33c5daa4ef Mark Salter 2014-01-23 22 #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
d57c33c5daa4ef Mark Salter 2014-01-23 23

:::::: The code at line 21 was first introduced by commit
:::::: d57c33c5daa4efa9e4d303bd0faf868080b532be add generic fixmap.h

:::::: TO: Mark Salter <msalter@xxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx