]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bitmap: Remove dead code, i.e. bitmap_copy_le()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 17 Aug 2023 16:20:54 +0000 (19:20 +0300)
committerYury Norov <yury.norov@gmail.com>
Sun, 15 Oct 2023 03:25:22 +0000 (20:25 -0700)
Besides the fact it's not used anywhere it should be implemented
differently, i.e. via helpers from linux/byteorder/generic.h.
Yet the helpers themselves need to be introduced first.

Also note, the function lacks of the test cases, they must be provided.

Hence, drop the current dead code for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
include/linux/bitmap.h
lib/bitmap.c

index 03644237e1efb5316b62e9831515d12b9f9f28b6..1516ff9793151e4b2a27c2b107e59c9abf6b003e 100644 (file)
@@ -220,11 +220,6 @@ int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
 void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
 int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);
 
-#ifdef __BIG_ENDIAN
-void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits);
-#else
-#define bitmap_copy_le bitmap_copy
-#endif
 int bitmap_print_to_pagebuf(bool list, char *buf,
                                   const unsigned long *maskp, int nmaskbits);
 
index 24284caadbcc690a1f31a26b38320f6d03750c09..935e0f96e785d9d99d8b36aa8b7ea44ceb5b8337 100644 (file)
@@ -1360,29 +1360,6 @@ int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
 }
 EXPORT_SYMBOL(bitmap_allocate_region);
 
-/**
- * bitmap_copy_le - copy a bitmap, putting the bits into little-endian order.
- * @dst:   destination buffer
- * @src:   bitmap to copy
- * @nbits: number of bits in the bitmap
- *
- * Require nbits % BITS_PER_LONG == 0.
- */
-#ifdef __BIG_ENDIAN
-void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits)
-{
-       unsigned int i;
-
-       for (i = 0; i < nbits/BITS_PER_LONG; i++) {
-               if (BITS_PER_LONG == 64)
-                       dst[i] = cpu_to_le64(src[i]);
-               else
-                       dst[i] = cpu_to_le32(src[i]);
-       }
-}
-EXPORT_SYMBOL(bitmap_copy_le);
-#endif
-
 unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
 {
        return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long),