arch/mips/include/asm/addrspace.h:88:37: warning: passing argument 1 of 'kfree' makes pointer from integer without a cast

From: kernel test robot
Date: Fri Oct 16 2020 - 06:05:16 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ff9b0d392ea08090cd1780fb196f36dbb586529
commit: 3af5f0f5c74ecbaf757ef06c3f80d56751277637 net: korina: fix kfree of rx/tx descriptor array
date: 4 days ago
config: mips-rb532_defconfig (attached as .config)
compiler: mipsel-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=3af5f0f5c74ecbaf757ef06c3f80d56751277637
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3af5f0f5c74ecbaf757ef06c3f80d56751277637
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips

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/mips/include/asm/barrier.h:11,
from arch/mips/include/asm/bitops.h:19,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/net/ethernet/korina.c:36:
drivers/net/ethernet/korina.c: In function 'korina_probe':
>> arch/mips/include/asm/addrspace.h:88:37: warning: passing argument 1 of 'kfree' makes pointer from integer without a cast [-Wint-conversion]
88 | #define KSEG0ADDR(a) (CPHYSADDR(a) | KSEG0)
| ~~~~~~~~~~~~~~^~~~~~~~
| |
| unsigned int
drivers/net/ethernet/korina.c:1116:8: note: in expansion of macro 'KSEG0ADDR'
1116 | kfree(KSEG0ADDR(lp->td_ring));
| ^~~~~~~~~
In file included from include/linux/irq.h:21,
from include/asm-generic/hardirq.h:13,
from arch/mips/include/asm/hardirq.h:16,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from drivers/net/ethernet/korina.c:42:
include/linux/slab.h:185:12: note: expected 'const void *' but argument is of type 'unsigned int'
185 | void kfree(const void *);
| ^~~~~~~~~~~~
In file included from arch/mips/include/asm/barrier.h:11,
from arch/mips/include/asm/bitops.h:19,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/net/ethernet/korina.c:36:
drivers/net/ethernet/korina.c: In function 'korina_remove':
>> arch/mips/include/asm/addrspace.h:88:37: warning: passing argument 1 of 'kfree' makes pointer from integer without a cast [-Wint-conversion]
88 | #define KSEG0ADDR(a) (CPHYSADDR(a) | KSEG0)
| ~~~~~~~~~~~~~~^~~~~~~~
| |
| unsigned int
drivers/net/ethernet/korina.c:1136:8: note: in expansion of macro 'KSEG0ADDR'
1136 | kfree(KSEG0ADDR(lp->td_ring));
| ^~~~~~~~~
In file included from include/linux/irq.h:21,
from include/asm-generic/hardirq.h:13,
from arch/mips/include/asm/hardirq.h:16,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from drivers/net/ethernet/korina.c:42:
include/linux/slab.h:185:12: note: expected 'const void *' but argument is of type 'unsigned int'
185 | void kfree(const void *);
| ^~~~~~~~~~~~

vim +/kfree +88 arch/mips/include/asm/addrspace.h

^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 84
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 85 /*
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 86 * Map an address to a certain kernel segment
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 87 */
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 @88 #define KSEG0ADDR(a) (CPHYSADDR(a) | KSEG0)
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 89 #define KSEG1ADDR(a) (CPHYSADDR(a) | KSEG1)
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 90 #define KSEG2ADDR(a) (CPHYSADDR(a) | KSEG2)
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 91 #define KSEG3ADDR(a) (CPHYSADDR(a) | KSEG3)
^1da177e4c3f415 include/asm-mips/addrspace.h Linus Torvalds 2005-04-16 92

:::::: The code at line 88 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip