Commit 2d469737 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

swab: Add array operations

For now, some simple array operations to swab.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220831212744.56435-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6ed406ef
......@@ -20,4 +20,29 @@
# define swab64s __swab64s
# define swahw32s __swahw32s
# define swahb32s __swahb32s
static inline void swab16_array(u16 *buf, unsigned int words)
{
while (words--) {
swab16s(buf);
buf++;
}
}
static inline void swab32_array(u32 *buf, unsigned int words)
{
while (words--) {
swab32s(buf);
buf++;
}
}
static inline void swab64_array(u64 *buf, unsigned int words)
{
while (words--) {
swab64s(buf);
buf++;
}
}
#endif /* _LINUX_SWAB_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment