arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0'

From: kernel test robot
Date: Tue Jun 15 2021 - 05:52:47 EST


Hi Christophe,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 009c9aa5be652675a06d5211e1640e02bbb1c33d
commit: 4eeef098b43242ed145c83fba9989d586d707589 powerpc/44x: Remove STDBINUTILS kconfig option
date: 5 months ago
config: powerpc-randconfig-r032-20210615 (attached as .config)
compiler: powerpc-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
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4eeef098b43242ed145c83fba9989d586d707589
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4eeef098b43242ed145c83fba9989d586d707589
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

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/powerpc/include/asm/thread_info.h:13,
from include/linux/thread_info.h:56,
from include/asm-generic/preempt.h:5,
from ./arch/powerpc/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:6,
from include/linux/umh.h:4,
from include/linux/kmod.h:9,
from include/linux/module.h:16,
from drivers/net/vmxnet3/vmxnet3_drv.c:27:
drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_rq_init':
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1784:29: note: in expansion of macro 'PAGE_SIZE'
1784 | rq->buf_info[0][i].len = PAGE_SIZE;
| ^~~~~~~~~
>> arch/powerpc/include/asm/page.h:24:20: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '262144' to '0' [-Woverflow]
24 | #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
| ^
drivers/net/vmxnet3/vmxnet3_drv.c:1789:28: note: in expansion of macro 'PAGE_SIZE'
1789 | rq->buf_info[1][i].len = PAGE_SIZE;
| ^~~~~~~~~


vim +24 arch/powerpc/include/asm/page.h

5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 16
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 17 /*
e12401222f749c arch/powerpc/include/asm/page.h Yuri Tikhonov 2009-01-29 18 * On regular PPC32 page size is 4K (but we support 4K/16K/64K/256K pages
555f4fdb93e70d arch/powerpc/include/asm/page.h Christophe Leroy 2019-02-21 19 * on PPC44x and 4K/16K on 8xx). For PPC64 we support either 4K or 64K software
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 20 * page size. When using 64K pages however, whether we are really supporting
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 21 * 64K pages in HW or not is irrelevant to those definitions.
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 22 */
555f4fdb93e70d arch/powerpc/include/asm/page.h Christophe Leroy 2019-02-21 23 #define PAGE_SHIFT CONFIG_PPC_PAGE_SHIFT
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 @24 #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
5cd16ee934eafc include/asm-powerpc/page.h Michael Ellerman 2005-11-11 25

:::::: The code at line 24 was first introduced by commit
:::::: 5cd16ee934eafca74a6bb790328950cec68a8b78 [PATCH] powerpc: Merge page.h

:::::: TO: Michael Ellerman <michael@xxxxxxxxxxxxxx>
:::::: CC: Paul Mackerras <paulus@xxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip