public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] swab: Add array operations
@ 2022-08-31 14:54 Andy Shevchenko
  2022-08-31 14:54 ` [PATCH v1 2/3] regmap: mmio: Use swabXX_array() helpers Andy Shevchenko
  2022-08-31 14:54 ` [PATCH v1 3/3] regmap: spi-avmm: " Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2022-08-31 14:54 UTC (permalink / raw)
  To: Andy Shevchenko, Mark Brown, linux-kernel
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Linus Walleij

For now, some simple array operations to swab.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/swab.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/linux/swab.h b/include/linux/swab.h
index bcff5149861a..9b804dbb0d79 100644
--- a/include/linux/swab.h
+++ b/include/linux/swab.h
@@ -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 */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-31 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-31 14:54 [PATCH v1 1/3] swab: Add array operations Andy Shevchenko
2022-08-31 14:54 ` [PATCH v1 2/3] regmap: mmio: Use swabXX_array() helpers Andy Shevchenko
2022-08-31 14:54 ` [PATCH v1 3/3] regmap: spi-avmm: " Andy Shevchenko
2022-08-31 20:12   ` kernel test robot
2022-08-31 21:19     ` Andy Shevchenko
2022-08-31 21:22   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox