[dhowells-fs:netfs-next 11/28] fs/netfs/bvecq.c:77:20: error: assignment to 'struct bvecq *' from 'int' makes pointer from integer without a cast

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git netfs-next
head:   3ae015ad2054541c8e406c9dc3e838849bacbabc
commit: 46ffbdd7331ff70da4b75f9275ce7115db637cf0 [11/28] netfs: Make mempool available for bvecq
config: parisc-defconfig (https://download.01.org/0day-ci/archive/20260824/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260824/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

   fs/netfs/bvecq.c: In function 'bvecq_alloc_one':
   fs/netfs/bvecq.c:77:22: error: implicit declaration of function 'mempool_alloc'; did you mean 'mm_alloc'? [-Wimplicit-function-declaration]
      77 |                 bq = mempool_alloc(&netfs_bvecq_pool, gfp);
         |                      ^~~~~~~~~~~~~
         |                      mm_alloc
>> fs/netfs/bvecq.c:77:20: error: assignment to 'struct bvecq *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      77 |                 bq = mempool_alloc(&netfs_bvecq_pool, gfp);
         |                    ^
   fs/netfs/bvecq.c: In function 'bvecq_put':
   fs/netfs/bvecq.c:275:25: error: implicit declaration of function 'mempool_free' [-Wimplicit-function-declaration]
     275 |                         mempool_free(bq, &netfs_bvecq_pool);
         |                         ^~~~~~~~~~~~


vim +77 fs/netfs/bvecq.c

    40	
    41	/**
    42	 * bvecq_alloc_one - Allocate a single bvecq node with unpopulated slots
    43	 * @nr_slots: Number of slots to allocate
    44	 * @gfp: The allocation constraints.
    45	 * @for_writeback: True if allocating for writeback
    46	 *
    47	 * Allocate a single bvecq node and initialise the header.  A number of inline
    48	 * slots are also allocated, rounded up to fit after the header in a power-of-2
    49	 * slab object of up to 512 bytes (up to 29 slots on a 64-bit cpu).  The caller
    50	 * should be aware that the number of slots allocated may be more or less than
    51	 * the number requested.  The slot array is not initialised.
    52	 *
    53	 * Return: The node pointer or NULL on allocation failure.
    54	 */
    55	struct bvecq *bvecq_alloc_one(size_t nr_slots, gfp_t gfp, bool for_writeback)
    56	{
    57		struct bvecq *bq;
    58		const size_t max_size = 512;
    59		const size_t max_slots = (max_size - sizeof(*bq)) / sizeof(bq->__bv[0]);
    60		size_t part = min(nr_slots, max_slots);
    61		size_t size = roundup_pow_of_two(struct_size(bq, __bv, part));
    62		bool from_pool = false;
    63	
    64		gfp &= ~(GFP_ZONEMASK | __GFP_THISNODE);
    65	
    66		if (for_writeback) {
    67			if (size != BVECQ_STD_SIZE) {
    68				gfp_t gfp_temp = gfp;
    69	
    70				gfp_temp |= __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN;
    71				gfp_temp &= ~(__GFP_DIRECT_RECLAIM | __GFP_IO);
    72				bq = kmalloc(size, gfp_temp);
    73				if (bq)
    74					goto success;
    75			}
    76	
  > 77			bq = mempool_alloc(&netfs_bvecq_pool, gfp);
    78			if (!bq)
    79				return bq;
    80			from_pool = true;
    81			size = BVECQ_STD_SIZE;
    82		} else {
    83			bq = kmalloc(size, gfp);
    84			if (!bq)
    85				return bq;
    86		}
    87	
    88	success:
    89		*bq = (struct bvecq) {
    90			.ref		= REFCOUNT_INIT(1),
    91			.bv		= bq->__bv,
    92			.inline_bv	= true,
    93			.max_slots	= (size - sizeof(*bq)) / sizeof(bq->__bv[0]),
    94			.from_pool	= from_pool,
    95		};
    96		netfs_stat(&netfs_n_bvecq);
    97		return bq;
    98	}
    99	EXPORT_SYMBOL(bvecq_alloc_one);
   100	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.