All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/8] byteorder: Introduce cpu_to_le16_array() and le16_to_cpu_array()
@ 2020-08-17 18:46 Andy Shevchenko
  2020-08-17 18:46 ` [PATCH v2 2/8] media: solo6x10: Make use of cpu_to_le16_array() Andy Shevchenko
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Andy Shevchenko @ 2020-08-17 18:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb, Mathias Nyman
  Cc: Andy Shevchenko, Anton Sviridenko, Andrey Utkin, Ismael Luceno,
	Mauro Carvalho Chehab, Jussi Kivilinna, Kalle Valo, Jeff Kirsher,
	Sylwia Wnuczko, Jesse Brandeburg

Introduce cpu_to_le16_array() and le16_to_cpu_array() for existing and
future users.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Anton Sviridenko <anton@corp.bluecherry.net>
Cc: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Cc: Ismael Luceno <ismael@iodev.co.uk>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Sylwia Wnuczko <sylwia.wnuczko@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
v2: split out of the USB patch

The idea, how I see it, is to push entire series via USB tree as a main
target of it. The immutable branch can be used for others to pick up.
Of course maintainers can propose better approach.

 include/linux/byteorder/generic.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/linux/byteorder/generic.h b/include/linux/byteorder/generic.h
index 4b13e0a3e15b..24904ad79df0 100644
--- a/include/linux/byteorder/generic.h
+++ b/include/linux/byteorder/generic.h
@@ -156,6 +156,22 @@ static inline void le64_add_cpu(__le64 *var, u64 val)
 	*var = cpu_to_le64(le64_to_cpu(*var) + val);
 }
 
+static inline void cpu_to_le16_array(__le16 *dst, const u16 *src, size_t len)
+{
+	int i;
+
+	for (i = 0; i < len; i++)
+		dst[i] = cpu_to_le16(src[i]);
+}
+
+static inline void le16_to_cpu_array(u16 *dst, const __le16 *src, size_t len)
+{
+	int i;
+
+	for (i = 0; i < len; i++)
+		dst[i] = le16_to_cpu(src[i]);
+}
+
 /* XXX: this stuff can be optimized */
 static inline void le32_to_cpu_array(u32 *buf, unsigned int words)
 {
-- 
2.28.0


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

end of thread, other threads:[~2020-08-18  8:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 18:46 [PATCH v2 1/8] byteorder: Introduce cpu_to_le16_array() and le16_to_cpu_array() Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 2/8] media: solo6x10: Make use of cpu_to_le16_array() Andy Shevchenko
2020-08-17 22:18   ` Ismael Luceno
2020-08-17 18:46 ` [PATCH v2 3/8] rndis_wlan: " Andy Shevchenko
2020-08-17 22:02   ` kernel test robot
2020-08-17 22:02     ` kernel test robot
2020-08-18  5:36   ` Kalle Valo
2020-08-18  5:36   ` Jussi Kivilinna
2020-08-17 18:46 ` [PATCH v2 4/8] i40e: Make use of le16_to_cpu_array() Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 5/8] ice: " Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 6/8] usb: early: xhci-dbc: use readl_poll_timeout() to simplify code Andy Shevchenko
2020-08-17 18:46 ` [PATCH v2 7/8] usb: early: xhci-dbc: Make use of cpu_to_le16_array() Andy Shevchenko
2020-08-17 21:23   ` kernel test robot
2020-08-17 21:23     ` kernel test robot
2020-08-17 18:46 ` [PATCH v2 8/8] usb: early: xhci-dbc: Move asm/* headers after linux/* Andy Shevchenko
2020-08-18  8:01 ` [PATCH v2 1/8] byteorder: Introduce cpu_to_le16_array() and le16_to_cpu_array() Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.