Hi Sean, [FYI, it's a private test report for your RFC patch.] [auto build test WARNING on mtd/mtd/next] [also build test WARNING on mtd/mtd/fixes mtd/nand/next v5.15-rc4 next-20211008] [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/0day-ci/linux/commits/Sean-Nyekjaer/mtd-core-protect-access-to-mtd-devices-while-in-suspend/20211008-224107 base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next config: riscv-randconfig-r033-20211008 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 8ed2e8e04ff42eb4d8009999ae1fd341a30bf6c0) 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 # install riscv cross compiling tool for clang build # apt-get install binutils-riscv64-linux-gnu # https://github.com/0day-ci/linux/commit/d83ca808e3d10c716b9ba1bab5a34a6f20875041 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Sean-Nyekjaer/mtd-core-protect-access-to-mtd-devices-while-in-suspend/20211008-224107 git checkout d83ca808e3d10c716b9ba1bab5a34a6f20875041 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/mtd/nand/raw/nand_base.c:40: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/riscv/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/riscv/include/asm/io.h:136: include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from drivers/mtd/nand/raw/nand_base.c:40: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/riscv/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/riscv/include/asm/io.h:136: include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from drivers/mtd/nand/raw/nand_base.c:40: In file included from include/linux/interrupt.h:11: In file included from include/linux/hardirq.h:11: In file included from ./arch/riscv/include/generated/asm/hardirq.h:1: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/riscv/include/asm/io.h:136: include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port; ~~~~~~~~~~ ^ >> drivers/mtd/nand/raw/nand_base.c:4347:2: warning: variable 'ret' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] default: ^~~~~~~ drivers/mtd/nand/raw/nand_base.c:4358:9: note: uninitialized use occurs here return ret; ^~~ drivers/mtd/nand/raw/nand_base.c:4335:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 8 warnings generated. vim +/ret +4347 drivers/mtd/nand/raw/nand_base.c 2af7c653993199 drivers/mtd/nand/nand_base.c Simon Kagstrom 2009-10-05 4324 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4325 /** 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4326 * nand_write_oob - [MTD Interface] NAND write data and/or out-of-band 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4327 * @mtd: MTD device structure 844d3b427ef1a4 drivers/mtd/nand/nand_base.c Randy Dunlap 2006-06-28 4328 * @to: offset to write to 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4329 * @ops: oob operation description structure 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4330 */ 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4331 static int nand_write_oob(struct mtd_info *mtd, loff_t to, 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4332 struct mtd_oob_ops *ops) 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4333 { 0813621ba898aa drivers/mtd/nand/raw/nand_base.c Boris Brezillon 2018-11-11 4334 struct nand_chip *chip = mtd_to_nand(mtd); 80107e764846a6 drivers/mtd/nand/raw/nand_base.c Colin Ian King 2019-07-31 4335 int ret; 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4336 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4337 ops->retlen = 0; 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4338 d83ca808e3d10c drivers/mtd/nand/raw/nand_base.c Sean Nyekjaer 2021-10-08 4339 nand_get_device(chip); 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4340 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4341 switch (ops->mode) { 0612b9ddc2eeda drivers/mtd/nand/nand_base.c Brian Norris 2011-08-30 4342 case MTD_OPS_PLACE_OOB: 0612b9ddc2eeda drivers/mtd/nand/nand_base.c Brian Norris 2011-08-30 4343 case MTD_OPS_AUTO_OOB: 0612b9ddc2eeda drivers/mtd/nand/nand_base.c Brian Norris 2011-08-30 4344 case MTD_OPS_RAW: 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4345 break; 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4346 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 @4347 default: 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4348 goto out; 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4349 } 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4350 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4351 if (!ops->datbuf) 0813621ba898aa drivers/mtd/nand/raw/nand_base.c Boris Brezillon 2018-11-11 4352 ret = nand_do_write_oob(chip, to, ops); 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4353 else 0813621ba898aa drivers/mtd/nand/raw/nand_base.c Boris Brezillon 2018-11-11 4354 ret = nand_do_write_ops(chip, to, ops); 8593fbc68b0df1 drivers/mtd/nand/nand_base.c Thomas Gleixner 2006-05-29 4355 ^1da177e4c3f41 drivers/mtd/nand/nand_base.c Linus Torvalds 2005-04-16 4356 out: 0813621ba898aa drivers/mtd/nand/raw/nand_base.c Boris Brezillon 2018-11-11 4357 nand_release_device(chip); ^1da177e4c3f41 drivers/mtd/nand/nand_base.c Linus Torvalds 2005-04-16 4358 return ret; ^1da177e4c3f41 drivers/mtd/nand/nand_base.c Linus Torvalds 2005-04-16 4359 } ^1da177e4c3f41 drivers/mtd/nand/nand_base.c Linus Torvalds 2005-04-16 4360 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org