Skip to content

Commit 7733aa8

Browse files
andy-shevYuryNorov
authored andcommitted
bitmap: Remove dead code, i.e. bitmap_copy_le()
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>
1 parent 8ed13a7 commit 7733aa8

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

include/linux/bitmap.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ int bitmap_find_free_region(unsigned long *bitmap, unsigned int bits, int order)
220220
void bitmap_release_region(unsigned long *bitmap, unsigned int pos, int order);
221221
int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order);
222222

223-
#ifdef __BIG_ENDIAN
224-
void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits);
225-
#else
226-
#define bitmap_copy_le bitmap_copy
227-
#endif
228223
int bitmap_print_to_pagebuf(bool list, char *buf,
229224
const unsigned long *maskp, int nmaskbits);
230225

lib/bitmap.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,29 +1360,6 @@ int bitmap_allocate_region(unsigned long *bitmap, unsigned int pos, int order)
13601360
}
13611361
EXPORT_SYMBOL(bitmap_allocate_region);
13621362

1363-
/**
1364-
* bitmap_copy_le - copy a bitmap, putting the bits into little-endian order.
1365-
* @dst: destination buffer
1366-
* @src: bitmap to copy
1367-
* @nbits: number of bits in the bitmap
1368-
*
1369-
* Require nbits % BITS_PER_LONG == 0.
1370-
*/
1371-
#ifdef __BIG_ENDIAN
1372-
void bitmap_copy_le(unsigned long *dst, const unsigned long *src, unsigned int nbits)
1373-
{
1374-
unsigned int i;
1375-
1376-
for (i = 0; i < nbits/BITS_PER_LONG; i++) {
1377-
if (BITS_PER_LONG == 64)
1378-
dst[i] = cpu_to_le64(src[i]);
1379-
else
1380-
dst[i] = cpu_to_le32(src[i]);
1381-
}
1382-
}
1383-
EXPORT_SYMBOL(bitmap_copy_le);
1384-
#endif
1385-
13861363
unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
13871364
{
13881365
return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long),

0 commit comments

Comments
 (0)