public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [axboe-block:for-6.5/block 65/74] drivers/md/raid1.c:1151:4: error: incompatible pointer to integer conversion passing 'struct page *' to parameter of type 'unsigned long'
@ 2023-05-31 22:48 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-05-31 22:48 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: llvm, oe-kbuild-all, Jens Axboe, Christoph Hellwig,
	Damien Le Moal

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-6.5/block
head:   8e8fedab1194ef90e007636eb3d224c4f8e979a7
commit: 6473bc325644b9c8473e6c92bfb520a68dce1e12 [65/74] md: check for failure when adding pages in alloc_behind_master_bio
config: hexagon-randconfig-r006-20230531 (https://download.01.org/0day-ci/archive/20230601/202306010613.CU3wImBk-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 4faf3aaf28226a4e950c103a14f6fc1d1fdabb1b)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        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/axboe/linux-block.git/commit/?id=6473bc325644b9c8473e6c92bfb520a68dce1e12
        git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
        git fetch --no-tags axboe-block for-6.5/block
        git checkout 6473bc325644b9c8473e6c92bfb520a68dce1e12
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/md/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306010613.CU3wImBk-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/md/raid1.c:28:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/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/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547: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:560: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:37:51: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
                                                     ^
   In file included from drivers/md/raid1.c:28:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/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/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573: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:35:51: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
                                                     ^
   In file included from drivers/md/raid1.c:28:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:12:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/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/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584: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:594: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:604: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);
                                                         ~~~~~~~~~~ ^
>> drivers/md/raid1.c:1151:4: error: incompatible pointer to integer conversion passing 'struct page *' to parameter of type 'unsigned long' [-Wint-conversion]
                           free_page(page);
                           ^~~~~~~~~~~~~~~
   include/linux/gfp.h:320:36: note: expanded from macro 'free_page'
   #define free_page(addr) free_pages((addr), 0)
                                      ^~~~~~
   include/linux/gfp.h:303:38: note: passing argument to parameter 'addr' here
   extern void free_pages(unsigned long addr, unsigned int order);
                                        ^
   6 warnings and 1 error generated.


vim +1151 drivers/md/raid1.c

  1122	
  1123	static void alloc_behind_master_bio(struct r1bio *r1_bio,
  1124						   struct bio *bio)
  1125	{
  1126		int size = bio->bi_iter.bi_size;
  1127		unsigned vcnt = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
  1128		int i = 0;
  1129		struct bio *behind_bio = NULL;
  1130	
  1131		behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO,
  1132					      &r1_bio->mddev->bio_set);
  1133		if (!behind_bio)
  1134			return;
  1135	
  1136		/* discard op, we don't support writezero/writesame yet */
  1137		if (!bio_has_data(bio)) {
  1138			behind_bio->bi_iter.bi_size = size;
  1139			goto skip_copy;
  1140		}
  1141	
  1142		while (i < vcnt && size) {
  1143			struct page *page;
  1144			int len = min_t(int, PAGE_SIZE, size);
  1145	
  1146			page = alloc_page(GFP_NOIO);
  1147			if (unlikely(!page))
  1148				goto free_pages;
  1149	
  1150			if (!bio_add_page(behind_bio, page, len, 0)) {
> 1151				free_page(page);
  1152				goto free_pages;
  1153			}
  1154	
  1155			size -= len;
  1156			i++;
  1157		}
  1158	
  1159		bio_copy_data(behind_bio, bio);
  1160	skip_copy:
  1161		r1_bio->behind_master_bio = behind_bio;
  1162		set_bit(R1BIO_BehindIO, &r1_bio->state);
  1163	
  1164		return;
  1165	
  1166	free_pages:
  1167		pr_debug("%dB behind alloc failed, doing sync I/O\n",
  1168			 bio->bi_iter.bi_size);
  1169		bio_free_pages(behind_bio);
  1170		bio_put(behind_bio);
  1171	}
  1172	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [axboe-block:for-6.5/block 65/74] drivers/md/raid1.c:1151:4: error: incompatible pointer to integer conversion passing 'struct page *' to parameter of type 'unsigned long'
@ 2023-05-31 22:58 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-05-31 22:58 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: llvm, oe-kbuild-all, Jens Axboe, Christoph Hellwig,
	Damien Le Moal

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-6.5/block
head:   8e8fedab1194ef90e007636eb3d224c4f8e979a7
commit: 6473bc325644b9c8473e6c92bfb520a68dce1e12 [65/74] md: check for failure when adding pages in alloc_behind_master_bio
config: s390-randconfig-r044-20230531 (https://download.01.org/0day-ci/archive/20230601/202306010608.8DwJ0Mrp-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 4faf3aaf28226a4e950c103a14f6fc1d1fdabb1b)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install s390 cross compiling tool for clang build
        # apt-get install binutils-s390x-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?id=6473bc325644b9c8473e6c92bfb520a68dce1e12
        git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
        git fetch --no-tags axboe-block for-6.5/block
        git checkout 6473bc325644b9c8473e6c92bfb520a68dce1e12
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=s390 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/md/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306010608.8DwJ0Mrp-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/md/raid1.c:34:
   In file included from include/trace/events/block.h:8:
   In file included from include/linux/blktrace_api.h:5:
   In file included from include/linux/blk-mq.h:8:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:547: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:560: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/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
   #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
                                                             ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
   #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
                                                        ^
   In file included from drivers/md/raid1.c:34:
   In file included from include/trace/events/block.h:8:
   In file included from include/linux/blktrace_api.h:5:
   In file included from include/linux/blk-mq.h:8:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:573: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/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
   #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
                                                             ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
   #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
                                                        ^
   In file included from drivers/md/raid1.c:34:
   In file included from include/trace/events/block.h:8:
   In file included from include/linux/blktrace_api.h:5:
   In file included from include/linux/blk-mq.h:8:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:75:
   include/asm-generic/io.h:584: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:594: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:604: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:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsb(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsw(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           readsl(PCI_IOBASE + addr, buffer, count);
                  ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesb(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesw(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
           writesl(PCI_IOBASE + addr, buffer, count);
                   ~~~~~~~~~~ ^
>> drivers/md/raid1.c:1151:4: error: incompatible pointer to integer conversion passing 'struct page *' to parameter of type 'unsigned long' [-Wint-conversion]
                           free_page(page);
                           ^~~~~~~~~~~~~~~
   include/linux/gfp.h:320:36: note: expanded from macro 'free_page'
   #define free_page(addr) free_pages((addr), 0)
                                      ^~~~~~
   include/linux/gfp.h:303:38: note: passing argument to parameter 'addr' here
   extern void free_pages(unsigned long addr, unsigned int order);
                                        ^
   12 warnings and 1 error generated.


vim +1151 drivers/md/raid1.c

  1122	
  1123	static void alloc_behind_master_bio(struct r1bio *r1_bio,
  1124						   struct bio *bio)
  1125	{
  1126		int size = bio->bi_iter.bi_size;
  1127		unsigned vcnt = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
  1128		int i = 0;
  1129		struct bio *behind_bio = NULL;
  1130	
  1131		behind_bio = bio_alloc_bioset(NULL, vcnt, 0, GFP_NOIO,
  1132					      &r1_bio->mddev->bio_set);
  1133		if (!behind_bio)
  1134			return;
  1135	
  1136		/* discard op, we don't support writezero/writesame yet */
  1137		if (!bio_has_data(bio)) {
  1138			behind_bio->bi_iter.bi_size = size;
  1139			goto skip_copy;
  1140		}
  1141	
  1142		while (i < vcnt && size) {
  1143			struct page *page;
  1144			int len = min_t(int, PAGE_SIZE, size);
  1145	
  1146			page = alloc_page(GFP_NOIO);
  1147			if (unlikely(!page))
  1148				goto free_pages;
  1149	
  1150			if (!bio_add_page(behind_bio, page, len, 0)) {
> 1151				free_page(page);
  1152				goto free_pages;
  1153			}
  1154	
  1155			size -= len;
  1156			i++;
  1157		}
  1158	
  1159		bio_copy_data(behind_bio, bio);
  1160	skip_copy:
  1161		r1_bio->behind_master_bio = behind_bio;
  1162		set_bit(R1BIO_BehindIO, &r1_bio->state);
  1163	
  1164		return;
  1165	
  1166	free_pages:
  1167		pr_debug("%dB behind alloc failed, doing sync I/O\n",
  1168			 bio->bi_iter.bi_size);
  1169		bio_free_pages(behind_bio);
  1170		bio_put(behind_bio);
  1171	}
  1172	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-31 22:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-31 22:58 [axboe-block:for-6.5/block 65/74] drivers/md/raid1.c:1151:4: error: incompatible pointer to integer conversion passing 'struct page *' to parameter of type 'unsigned long' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-05-31 22:48 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox