linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [linux-next:master 12146/12451] include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared
Date: Tue, 17 Oct 2023 03:44:05 +0800	[thread overview]
Message-ID: <202310170340.tkkfdZYn-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4d0515b235dec789578d135a5db586b25c5870cb
commit: b9c957f5544422461e17b1010fa9114024632d7a [12146/12451] bitmap: move bitmap_*_region() functions to bitmap.h
config: arm-randconfig-s032-20220424 (https://download.01.org/0day-ci/archive/20231017/202310170340.tkkfdZYn-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231017/202310170340.tkkfdZYn-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310170340.tkkfdZYn-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from include/linux/cpumask.h:12,
                    from include/linux/mm_types_task.h:14,
                    from include/linux/mm_types.h:5,
                    from include/linux/buildid.h:5,
                    from include/linux/module.h:14,
                    from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39,
                    from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10,
                    from arch/arm/boot/compressed/decompress.c:60:
   include/linux/bitmap.h: In function 'bitmap_allocate_region':
>> include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function)
     527 |                 return -EBUSY;
         |                         ^~~~~
   include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/bitmap.h: In function 'bitmap_find_free_region':
>> include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function)
     554 |         return -ENOMEM;
         |                 ^~~~~~


vim +/EBUSY +527 include/linux/bitmap.h

   510	
   511	/**
   512	 * bitmap_allocate_region - allocate bitmap region
   513	 *	@bitmap: array of unsigned longs corresponding to the bitmap
   514	 *	@pos: beginning of bit region to allocate
   515	 *	@order: region size (log base 2 of number of bits) to allocate
   516	 *
   517	 * Allocate (set bits in) a specified region of a bitmap.
   518	 *
   519	 * Returns: 0 on success, or %-EBUSY if specified region wasn't
   520	 * free (not all bits were zero).
   521	 */
   522	static inline int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
   523	{
   524		unsigned int len = BIT(order);
   525	
   526		if (find_next_bit(bitmap, pos + len, pos) < pos + len)
 > 527			return -EBUSY;
   528		bitmap_set(bitmap, pos, len);
   529		return 0;
   530	}
   531	
   532	/**
   533	 * bitmap_find_free_region - find a contiguous aligned mem region
   534	 *	@bitmap: array of unsigned longs corresponding to the bitmap
   535	 *	@bits: number of bits in the bitmap
   536	 *	@order: region size (log base 2 of number of bits) to find
   537	 *
   538	 * Find a region of free (zero) bits in a @bitmap of @bits bits and
   539	 * allocate them (set them to one).  Only consider regions of length
   540	 * a power (@order) of two, aligned to that power of two, which
   541	 * makes the search algorithm much faster.
   542	 *
   543	 * Returns: the bit offset in bitmap of the allocated region,
   544	 * or -errno on failure.
   545	 */
   546	static inline int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
   547	{
   548		unsigned int pos, end;		/* scans bitmap by regions of size order */
   549	
   550		for (pos = 0; (end = pos + BIT(order)) <= bits; pos = end) {
   551			if (!bitmap_allocate_region(bitmap, pos, order))
   552				return pos;
   553		}
 > 554		return -ENOMEM;
   555	}
   556	

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


                 reply	other threads:[~2023-10-16 19:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202310170340.tkkfdZYn-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox