Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / util / memswap.c
blobc1317e4983bcf58908a5c371a1861f1f00dc34cf
1 // SPDX-License-Identifier: GPL-2.0
2 #include <byteswap.h>
3 #include "memswap.h"
4 #include <linux/types.h>
6 void mem_bswap_32(void *src, int byte_size)
8 u32 *m = src;
9 while (byte_size > 0) {
10 *m = bswap_32(*m);
11 byte_size -= sizeof(u32);
12 ++m;
16 void mem_bswap_64(void *src, int byte_size)
18 u64 *m = src;
20 while (byte_size > 0) {
21 *m = bswap_64(*m);
22 byte_size -= sizeof(u64);
23 ++m;