Merge tag 'ib-mfd-i2c-reboot-v6.7' into ibs-for-mfd-merged
[linux-block.git] / include / linux / swab.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
40c9f222
HH
2#ifndef _LINUX_SWAB_H
3#define _LINUX_SWAB_H
4
607ca46e 5#include <uapi/linux/swab.h>
40c9f222 6
40c9f222
HH
7# define swab16 __swab16
8# define swab32 __swab32
9# define swab64 __swab64
d5767057 10# define swab __swab
40c9f222
HH
11# define swahw32 __swahw32
12# define swahb32 __swahb32
13# define swab16p __swab16p
14# define swab32p __swab32p
15# define swab64p __swab64p
16# define swahw32p __swahw32p
17# define swahb32p __swahb32p
18# define swab16s __swab16s
19# define swab32s __swab32s
20# define swab64s __swab64s
21# define swahw32s __swahw32s
22# define swahb32s __swahb32s
2d469737
AS
23
24static inline void swab16_array(u16 *buf, unsigned int words)
25{
26 while (words--) {
27 swab16s(buf);
28 buf++;
29 }
30}
31
32static inline void swab32_array(u32 *buf, unsigned int words)
33{
34 while (words--) {
35 swab32s(buf);
36 buf++;
37 }
38}
39
40static inline void swab64_array(u64 *buf, unsigned int words)
41{
42 while (words--) {
43 swab64s(buf);
44 buf++;
45 }
46}
47
40c9f222 48#endif /* _LINUX_SWAB_H */