[linux-next:master 12146/12451] include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202310170340.tkkfdZYn-lkp@xxxxxxxxx/

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux