Re: [PATCH 24/32] kasan: move kasan_addr_to_slab to common.c

From: kernel test robot
Date: Wed Jun 15 2022 - 09:29:02 EST


Hi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v5.19-rc2 next-20220615]
[cannot apply to vbabka-slab/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/intel-lab-lkp/linux/commits/andrey-konovalov-linux-dev/kasan-switch-tag-based-modes-to-stack-ring-from-per-object-metadata/20220614-042239
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20220615/202206152134.sadCRvGk-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 11.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://github.com/intel-lab-lkp/linux/commit/b0b10a57b2d9a5e5ae5d7ca62046b9774df1a88f
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review andrey-konovalov-linux-dev/kasan-switch-tag-based-modes-to-stack-ring-from-per-object-metadata/20220614-042239
git checkout b0b10a57b2d9a5e5ae5d7ca62046b9774df1a88f
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash mm/kasan/

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

All warnings (new ones prefixed by >>):

mm/kasan/common.c: In function 'kasan_addr_to_slab':
>> mm/kasan/common.c:35:19: warning: ordered comparison of pointer with null pointer [-Wextra]
35 | if ((addr >= (void *)PAGE_OFFSET) && (addr < high_memory))
| ^~
mm/kasan/common.c: In function '____kasan_slab_free':
mm/kasan/common.c:202:12: warning: variable 'tag' set but not used [-Wunused-but-set-variable]
202 | u8 tag;
| ^~~


vim +35 mm/kasan/common.c

32
33 struct slab *kasan_addr_to_slab(const void *addr)
34 {
> 35 if ((addr >= (void *)PAGE_OFFSET) && (addr < high_memory))
36 return virt_to_slab(addr);
37 return NULL;
38 }
39

--
0-DAY CI Kernel Test Service
https://01.org/lkp